Skip to content

SgTypedefDeclaration

This class represents the notion of a typedef declaration.

Synopsis

Declared in <src/docs/mrdocs/ast_node_docs.h>

Base Classes

Name

Description

SgDeclarationStatement

This class represents the concept of a declaration statement.

Friends

Name

Description

isSgTypedefDeclaration

Casts pointer from base class to derived class (for const pointers)

isSgTypedefDeclaration

Casts pointer from base class to derived class

Non-Member Functions

Name

Description

AstPostProcessing

This does all post‐processing fixup and translation of the Sage III AST.

addPrototypesForTemplateInstantiations

Fixups transformations that have added template instantiations or caused template instantiations to be output so that there is a proper prototype declaration before the template instantation is called.

changeAllMembersToPublic

Change all members in a program to be public. There should really be a smarter procedure for this that only changes members used by inlined code.

checkIsCompilerGeneratedFlag

Checks whether appropriate nodes of an AST are marked as compiler‐generated.

checkIsFrontendSpecificFlag

Checks whether appropriate nodes of an AST are marked as front‐end specific.

checkPhysicalSourcePosition

Checks whether the physical source position information is consistant in the Sg_File_Info object

checkTransformedFlagsVisitor

Check for consistancy of isTransformation flags for nodes marked as a transformation.

cleanupInlinedCode

Combined procedure for cleaning up code after inlining. Does not do variable renaming or block flattening, however.

detectTransformations

Detect nodes marked as transformations (should not be present coming out of the frontend translation).

edgePointerReplacement

Traverse the AST root looking for the edges in the replacement map. If a match is found the edge is updated.

findVariablesUsedInRegion

Find all variables referenced in a region

fixReturnStatements

Workaround for ROSE bug. Should be used whenever expressions in a program are modified.

fixupAstDeclarationScope

Fixup all SgDeclarationStatement to have a consistant scope (between the defining and all non‐defining declarations).

fixupAstDefiningAndNondefiningDeclarations

Fixup all SgDeclarationStatement references to defining and non‐defining declarations.

fixupAstSymbolTables

Fixup global and local symbol tables.

fixupAstSymbolTablesToSupportAliasedSymbols

Fixup C++ symbol tables to use aliasing symbols for using declarations.

fixupDeclarations

Fixup definingDeclaration and firstNondefiningDeclaration pointers in SgDeclarationStatement.

fixupFileInfoInconsistanties

Checks and fixes up inconsistanties in the settings of Sg_File_Info flags (e.g. isTransformation flag) in the Sg_File_Info object

fixupFortranReferences

Fixup Fortran array vs. function references.

fixupFortranUseDeclarations

Fixup Fortran Use declarations.

fixupNullPointersInAST

Fixup specific pointers in the AST that we would like to not have be NULL.

fixupSelfReferentialMacrosInAST

Fixup known macros that reference themselves and cause recursive macro expansion in the generated (unparsed) code.

fixupStorageAccessOfForwardTemplateDeclarations

Fixup the storage access of all compiler‐generated forward declarations (non‐defining declarations) to match that of the defining declaration.

fixupTemplateInstantiations

Fixups template specializations generated by ROSE from template instantiations.

flattenBlocks

Flatten nested blocks of code in a program. This code requires that variable names in the region being processed are already distinct, and it may extend variable lifetimes to the end of the outer block of code.

getStatementOfExpression

Get the statement of an expression. Somewhat smarter than the standard version of this routine, but needs to be merged.

initializeExplicitScopeSupport

Initialize explicit scopes (support function should not be called).

initializeExplicitScopes

Initialize explicit scopes (located only at specific IR nodes).

insertFortranContainsStatement

Insert Fortran "CONTAINS" statement.

isMemberVariable

Internal routine to check whether a given variable declaration is a member variable.

isSgExpression

Casts pointer from base class to derived class (for const pointers)

isSgExpression

Casts pointer from base class to derived class

isSgInitializedName

Casts pointer from base class to derived class (for const pointers)

isSgInitializedName

Casts pointer from base class to derived class

isSgStatement

Casts pointer from base class to derived class

isSgStatement

Casts pointer from base class to derived class (for const pointers)

mangleTranslationUnitQualifiers

If the declaration has translation unit scope (as opposed to program scope), mangle the translation unit name.

markAsCompilerGenerated

Mark an AST subtree as compiler generated (used for instatiated templates generated by ROSE as specializations).

markBackendSpecificFunctionsAsCompilerGenerated

Mark an backend specific functions as compiler generated.

markForOutputInCodeGeneration

Mark an AST subtree as compiler generated and to be output in the source file (code generation phase).

markLhsValues

Mark relavant expressions as l‐values explicitly.

markOverloadedTemplateInstantiations

Mark any template instatiations that are overloaded (we can't output these since g++ can't resolve them).

markSharedDeclarationsForOutputInCodeGeneration

Mark an AST subtree to be unparsed using an alternative file (for multi‐file unparsing).

markTemplateInstantiationsForOutput

Fixups template instantiations generated by ROSE from template declarations.

markTransformationsForOutput

Fixups transformations (which are often marked at a high level and need to be marked properly through their subtree).

moveForDeclaredVariables

Move variables declared in a for statement to just outside that statement.

myStatementInsert

Insert a new statement before or after a target statement. If allowForInit is true, the new statement can be inserted into the initializer of a for statement. Needs to be merged

postProcessingSupport

Postprocessing that is not likely to be handled in the legacy frontend/Sage III translation.

processTemplateHandlingOptions

Fixup template instantiations to unmark them for output followingsemantics of gnu template options

propagateHiddenListData

Propagate hidden list information for variables, types, and class elaboration.

rebindVariableAndLabelReferences

Change all variable and label references to point to new symbols, created to point to the matching declaration found in the program. This needs to be moved into somewhere in FixSgTree.

removeNullStatements

Remove all null statements (those with only an integer constant or a null expression)

removeUnusedVariables

Remove unused variables in a scope

renameLabels

Rename all labels in a block of code.

renameVariables

Rename all variables in a block of code, and ensure that all variable references point to the correct declarations.

replaceChild

Replace a child of a node.

resetConstantFoldedValues

This function acts in two different ways

resetParentPointers

Interface function to reset parent pointers.

resetParentPointersInMemoryPool

This traversal calles ResetParentPointersInMemoryPool Memory Pool traversal.

resetParentPointersOfClassOrNamespaceDeclarations

This is a top level function not called recursively.

resetTemplateNames

Sets names of template classes (calls custom traversal).

simpleCopyAndConstantPropagation

In code with declarations such as "int foo = bar", where foo and bar are not modified, replace "foo" with "bar" and remove the declaration

simpleIndexFiniteDifferencing

Do a simple form of finite differencing on all functions contained within root (which should be a project, file, or function definition).

topLevelResetParentPointer

This is a top level function not called recursively.

unparseDeclarationToString

Unparse the declaration as a string for use in prototypes within the AST rewrite mechanism prefix mechanism

unparseStatementWithoutBasicBlockToString

Unparse header of statements that have bodies (but are not scopes) (e.g. SgDefaultOptionStmt)

ASTtools::appendCopy

Append a deep‐copy of statement s onto the basic block b.

ASTtools::collectDefdVarSyms

Collect var syms for all local variable declarations at 's'.

ASTtools::collectLocalVisibleVarSyms

Collect var syms declared at 'root' or below that are visible to 'target'.

ASTtools::collectNonLocalGotos

Collect non‐local "goto" statements.

ASTtools::collectNonLocalJumps

Collect non‐local "jumps" within a statement.

ASTtools::collectPointerDereferencingVarSyms

Collect variables suitable for using pointer dereferencing

ASTtools::collectRefdVarSyms

Collect var syms for all variable references at 's'.

ASTtools::collectThisExpressions

Collect 'this' expressions.

ASTtools::collectVarRefsOfTypeWithoutAssignmentSupport

Collect variable references with a type which does not support =operator or copy construction. Those two support is essential for temp variables used to copy and restore parameters

ASTtools::collectVarRefsUsingAddress

Collect variable references using addresses for s

ASTtools::createInfoList

Returns the preprocessing information list attached to the given statement; if no preprocessing information exists, then this routine will create an empty list and return its pointer. Thus, this routine is guaranteed to return a non‐NULL result.

ASTtools::deepCopy

Create a deep‐copy of an SgNode

ASTtools::dumpPreprocInfo

Dumps a statement's preprocessing information.

ASTtools::findFirstFuncDef

Search for the first surrounding function definition.

ASTtools::findFirstFuncDefScope

Search for the first surrounding scope that may contain a function def.

ASTtools::getUnqualUntmplName

Returns a non‐templated, unqualified name.

ASTtools::isC99

Returns 'true' if this node is contained in a C99‐only project.

ASTtools::isIfCond

Returns 'true' <==> 's' is the condition of some 'if' statement.

ASTtools::isSwitchCond

Returns 'true' <==> 's' is the conditional selector of some 'switch' statement.

ASTtools::isTemplateInst

Returns 'true' if the given declaration is a template instantiation.

ASTtools::isWhileCond

Returns 'true' <==> 's' is the condition of some 'while' or 'do ... while' statement.

ASTtools::moveAfterPreprocInfo

Moves 'after' preprocessing information.

ASTtools::moveBeforePreprocInfo

Moves 'before' preprocessing information.

ASTtools::moveUpPreprocInfo

Moves preprocessingInfo of stmt2 to stmt1.

ASTtools::replaceStatement

Replaces one statement with another.

ASTtools::setSourcePositionAsTransformation

Reset source position as transformation for the current node only

ASTtools::setSourcePositionAtRootAndAllChildrenAsTransformation

Reset source position as transformation recursively

ASTtools::toStringFileLoc

Convert a node's location to a string‐friendly form.

AstQueryNamespace::querySubTree

**** The function Result querySubTree ( SgNode * subTree, _Result (__x)(SgNode_,_Arg), Arg x_arg, AstQueryNamespace::QueryDepth defineQueryType =AstQueryNamespace::AllNodes ) will query the subtree of the IR node in the first argument for nodessatisfying the criteria specified in and returned by the function pointer inthe second argument.**

AstQueryNamespace::querySubTree

** The function Result querySubTree ( SgNode * subTree, _Result (__x)(SgNode_), AstQueryNamespace::QueryDepth defineQueryType =AstQueryNamespace::AllNodes )* will query the subtree of the IR node in the first argument for nodessatisfying the criteria specified in and returned by the function pointer inthe second argument.**

AstQueryNamespace::querySubTree

**** The function std::list<ListElement> querySubTree<ListElement>(SgNode* node,Predicate& _pred) will query the subtree of the IR node in the first argumentfor nodes satisfying the criteria specified in and returned by the predicatein the second argument.**

AstUtilInterface::CollectSideEffectVariables

Collect non‐local variables that are read and written within the given ast. This is a wrapper of the ComputeAstSideEffects function to provide a more convenient user interface. Returns true if the returned variables are guaranteed to be complete; returns false otherwise.

AstUtilInterface::ComputeAstSideEffects

Returns the collection of memory references modified, read, and invoked (as function calls) as potential side effects of running the given ast, inside the given scope.

CPreproc::extractIfDirectives

Extracts the '#if' directive structure from a project.

CPreproc::findIfDirectiveContext

Locate the '#if' directive context at a node.

CallTargetSet::solveFunctionPointerCallsFunctional

Checks if the functionDeclaration (node) matches functionType

ConstantFolding::constantFoldingOptimization

This is the external interface of constant folding:

NameQuery::querySubTree

****

NameQuery::querySubTree

****

NameQuery::querySubTree

****

NameQuery::querySubTree

****

NodeQuery::queryMemoryPool

** The function NodeQuerySynthesizedAttributeType queryMemoryPool ( SgNode * subTree, Result (*x)(SgNode*,_Arg), Arg x_arg, VariantVector ){ will on every node of the memory pool which has a corresponding variant inVariantVector performa the action specified by the second argument and returna NodeQuerySynthesizedAttributeType.*

NodeQuery::queryMemoryPool

** The function Result queryMemoryPool ( SgNode * subTree, SgNode, TypeOfQueryTypeTwoParameters, VariantVector* ){ will on every node of the memory pool which has a corresponding variant inVariantVector performa the predefined action specified by the second argumentand return a NodeQuerySynthesizedAttributeType.**

NodeQuery::queryMemoryPool

** The function Result queryMemoryPool ( SgNode * subTree, _Result (__x)(SgNode_), VariantVector* ){ will on every node of the memory pool which has a corresponding variant inVariantVector performa the action specified by the second argument and returna NodeQuerySynthesizedAttributeType.**

NodeQuery::querySubTree

****

NodeQuery::querySubTree

****

NodeQuery::querySubTree

****

NodeQuery::querySubTree

The function querySubTree (SgNode * subTree, VariantVector targetVariantVector, AstQueryNamespace::QueryDepth defineQueryType =AstQueryNamespace::AllNodes); reutnrs a list of all SgNodes us the ASTsub‐tree of the variable 'subTree' conforming to the variants inVariantVector.*****

NodeQuery::querySubTree

****

NodeQuery::querySubTree

****

NodeQuery::querySubTree

****

NumberQuery::querySubTree

****

NumberQuery::querySubTree

****

NumberQuery::querySubTree

****

NumberQuery::querySubTree

****

OmpSupport::addOmpClause

Attach an OpenMP clause to directive

OmpSupport::collectAllClauseVariables

Collect all variables from OpenMP clauses associated with an omp statement: private, reduction, etc

OmpSupport::collectClauseVariables

Collect variables from given types of OpenMP clauses associated with an omp statement: private, reduction, etc

OmpSupport::collectClauseVariables

Collect variables from a particular type of OpenMP clauses associated with an omp statement: private, reduction, etc

OmpSupport::generateOutlinedTask

A helper function to generate implicit or explicit task for either omp parallel or omp task

OmpSupport::getClause

Get OpenMP clauses from an eligible OpenMP statement

OmpSupport::getClauseExpression

Collect expression from given types of OpenMP clauses associated with an omp statement: private, reduction, etc

OmpSupport::getEnclosingRegionOrFuncDefinition

Find an enclosing parallel region or function definition's body

OmpSupport::hasClause

Check if an OpenMP statement has a clause of type vt

OmpSupport::isInOmpTargetRegion

Check whether a SgNode is inside omp target

OmpSupport::patchUpPrivateVariables

Patch up private variables for omp for. The reason is that loop indices should be private by default and this function will make this explicit

OmpSupport::removeClause

Remove one or more clauses of type vt

OmpSupport::replaceVariableReferences

Replace references to oldVar within root with references to newVar, return the number of references replaced.

OmpSupport::replaceVariableReferences

Replace variable references within root based on a map from old symbols to new symbols

OmpSupport::replaceVariablesWithPointerDereference

Replace all variable references in a set by pointers to the variable

OmpSupport::transOmpAtomic

Translate omp atomic

OmpSupport::transOmpBarrier

Translate omp barrier

OmpSupport::transOmpCritical

Translate omp critical

OmpSupport::transOmpFlush

Translate omp flush

OmpSupport::transOmpLoop

Translate omp for or omp do loops

OmpSupport::transOmpMaster

Translate omp master

OmpSupport::transOmpMetadirective

Translate omp metadirective

OmpSupport::transOmpOrdered

Translate the ordered directive (not the ordered clause)

OmpSupport::transOmpParallel

Translate omp parallel

OmpSupport::transOmpSections

Translate omp sections

OmpSupport::transOmpSimd

Translate omp simd

OmpSupport::transOmpSingle

Translate omp single

OmpSupport::transOmpTarget

Translate "omp target"

OmpSupport::transOmpTargetData

Translate "omp target data"

OmpSupport::transOmpTargetLoop

Translate omp for or omp do loops affected by the "omp target" directive, using naive 1‐to‐1 mapping Liao 1/28/2013

OmpSupport::transOmpTargetLoop_RoundRobin

Translate omp for or omp do loops affected by the "omp target" directive, using a round robin‐scheduler Liao 7/10/2014

OmpSupport::transOmpTargetParallel

Translate omp parallel under "omp target"

OmpSupport::transOmpTask

Translate omp task

OmpSupport::transOmpTaskwait

Translate omp taskwait

OmpSupport::transOmpThreadprivate

Translate omp threadprivate

OmpSupport::transOmpTile

Translate omp tile

OmpSupport::transOmpUnroll

Translate omp unroll

OmpSupport::transOmpVariables

Translate OpenMP variables associated with an OpenMP pragma, such as private, firstprivate, lastprivate, reduction, etc. bb1 is the translation generated code block in which the variable handling statements will be inserted. Original loop upper bound is needed for implementing lastprivate (check if it is the last iteration). withinAcceleratorModel means if we only translate private() variables, used to support accelerator model

Outliner::collectVars

Computes the set of variables in 's' that need to be passed to the outlined routine (semantically equivalent to shared variables in OpenMP)

Outliner::generateFuncArgName

Create a unique outlined‐function's wrapper argument name for the specified statement.

Outliner::generateFuncName

Create a unique outlined‐function name for the specified statement.

Outliner::generatePackingStatements

Generate packing (wrapping) statements for the variables to be passed

Outliner::isOutlineable

Returns true iff the statement is "outlineable."

Outliner::outline

Outlines the given statement. The main programming interface.

Outliner::outline

Outline to a new function with the specified name, calling preprocessing internally

ProcessExpression::processLHS

Helper Function to process Left Hand Side of an Expression

ProcessExpression::processRHS

Helper Function to process Right Hand Side of an Expression

Rose::getFileNameWithoutPath

get the sourceDirectory directory

Rose::getPreviousStatement

Functions to move to SgStatement object in SAGE III later

SageBuilder::buildBasicBlock

Build a SgBasicBlock, setting file info internally

SageBuilder::buildComment

Build and attach a comment, comment style is inferred from the language type of the target node if not provided. It is indeed a wrapper of SageInterface::attachComment().

SageBuilder::buildCpreprocessorDefineDeclaration

Build and attach #define XX directives, pass "#define xxx xxx" as content.

SageBuilder::buildDefaultOptionStmt

Build a default option statement

SageBuilder::buildDoWhileStmt

Build do‐while statement

SageBuilder::buildForStatement

Build a for statement, assume none of the arguments is NULL

SageBuilder::buildIfStmt

Build if statement

SageBuilder::buildStatementExpression

Build a GNU statement expression

SageBuilder::buildStmtDeclarationStatement

Build a StmtDeclarationStmt

SageBuilder::buildSwitchStatement

Build a switch statement

SageBuilder::buildTryStmt

Build a try statement.

SageBuilder::buildTypedefDeclaration

Build a typedef declaration, such as: typedef int myint; typedef struct A {..} s_A;

SageBuilder::buildWhileStmt

Build while statement

SageBuilder::errorCheckingTargetAST

Error checking the inserted snippet AST.

SageBuilder::fixupCopyOfAstFromSeparateFileInNewTargetAst

Fixup any AST moved from one file two another (references to symbols, types, etc.).

SageBuilder::fixupSharingSourcePosition

Sharing IR nodes requires that the file id be added to the fileIDsToUnparse held in the Sg_File_Info object.

SageBuilder::setTemplateArgumentsInDeclaration

DQ (9/16/2012): Added function to support setting the template arguments and setting their parents (and for any relevant declaration).

SageBuilder::testTemplateParameterParents

DQ (9/16/2012): Added function to support setting the template parameters and setting their parents (and for any relevant declaration).

SageInterface::addMessageStatement

Function to add "C" style comment to statement.

SageInterface::addTextForUnparser

Add a string to be unparsed to support code generation for back‐end specific tools or compilers.

SageInterface::addVarRefExpFromArrayDimInfo

Find all SgPntrArrRefExp under astNode, then add SgVarRefExp (if any) of SgPntrArrRefExp's dim_info into NodeList_t

SageInterface::appendStatement

Append a statement to the end of SgForInitStatement

SageInterface::appendStatement

Append a statement to the end of the current scope, handle side effect of appending statements, e.g. preprocessing info, defining/nondefining pointers etc.

SageInterface::appendStatementWithDependentDeclaration

Append a copy ('decl') of a function ('original_statement') into a 'scope', include any referenced declarations required if the scope is within a compiler generated file. All referenced declarations, including those from headers, are inserted if excludeHeaderFiles is set to true (the new file will not have any headers).

SageInterface::astIntersection

Compute the intersection set for two ASTs.

SageInterface::attachArbitraryText

Attach an arbitrary string to a located node. A workaround to insert irregular statements or vendor‐specific attributes.

SageInterface::attachComment

Build and attach comment, comment style is inferred from the language type of the target node if not provided

SageInterface::changeAllBodiesToBlocks

Fix up ifs, loops, while, switch, Catch, OmpBodyStatement, etc. to have blocks as body components. It also adds an empty else body to if statements that don't have them.

SageInterface::changeBreakStatementsToGotos

If the given statement contains any break statements in its body, add a new label below the statement and change the breaks into gotos to that new label.

SageInterface::changeContinuesToGotos

Change continue statements in a given block of code to gotos to a label

SageInterface::clearUnusedVariableSymbols

Clear those variable symbols with unknown type (together with initialized names) which are also not referenced by any variable references or declarations under root. If root is NULL, all symbols with unknown type will be deleted.

SageInterface::collectModifiedLocatedNodes

This collects the SgLocatedNodes that are marked as modified (a flag automatically set by all set_* generated functions) (useful in debugging).

SageInterface::collectModifiedStatements

This collects the statements that are marked as modified (a flag automatically set by all set_* generated functions) (useful in debugging).

SageInterface::collectReadOnlySymbols

Collect read only variable symbols within a statement. The statement can be either of a function, a scope, or a single line statement. For accesses to members of aggregate data, we return the coarse grain aggregate mem obj by default.

SageInterface::collectReadOnlyVariables

Collect read only variables within a statement. The statement can be either of a function, a scope, or a single line statement. For accesses to members of aggregate data, we return the coarse grain aggregate mem obj by default.

SageInterface::collectReadWriteRefs

Collect all read and write references within stmt, which can be a function, a scope statement, or a single statement. Note that a reference can be both read and written, like i++

SageInterface::collectReadWriteVariables

Collect unique variables which are read or written within a statement. Note that a variable can be both read and written. The statement can be either of a function, a scope, or a single line statement. For accesses to members of aggregate data, we return the coarse grain aggregate mem obj by default.

SageInterface::collectTransformedStatements

This collects the statements that are marked as transformed (useful in debugging).

SageInterface::collectUseByAddressVariableRefs

Collect variable references involving use by address: including &a expression and foo(a) when type2 foo(Type& parameter) in C++

SageInterface::collectVarRefs

Collect all variable references in a subtree

SageInterface::collectVariableReferencesInArrayTypes

Collect variable references in array types. The default NodeQuery::querySubTree() will miss variables referenced in array type's index list. e.g. double *buffer = new double[numItems];

SageInterface::computeUniqueNameForUseAsIdentifier

Traversal to set the global map of names to node and node to names.collisions to support generateUniqueNameForUseAsIdentifier() function.

SageInterface::constantFolding

Constant folding an AST subtree rooted at 'r' (replacing its children with their constant values, if applicable). Please be advised that constant folding on floating point computation may decrease the accuracy of floating point computations! It is a wrapper function for ConstantFolding::constantFoldingOptimization(). Note that only r's children are replaced with their corresponding constant values, not the input SgNode r itself. You have to call this upon an expression's parent node if you want to fold the expression.

SageInterface::convertFunctionDefinitionsToFunctionPrototypes

XXX This function operates on the new file used to support outlined function definitions. We use a copy of the file where the code will be outlined FROM, so that if there are references to declarations in the outlined code we can support the outpiled code with those references. This approach has the added advantage of also supporting the same include file tree as the original file where the outlined code is being taken from.

SageInterface::convertRefToInitializedName

Variable references can be introduced by SgVarRef, SgPntrArrRefExp, SgInitializedName, SgMemberFunctionRef etc. For Dot and Arrow Expressions, their lhs is used to obtain SgInitializedName (coarse grain) by default. Otherwise, fine‐grain rhs is used.

SageInterface::copyStatement

Deep copy a statement

SageInterface::cutPreprocessingInfo

Cut preprocessing information from a source node and save it into a buffer. Used in combination of pastePreprocessingInfo(). The cut‐paste operation is similar to moveUpPreprocessingInfo() but it is more flexible in that the destination node can be unknown during the cut operation.

SageInterface::declarationPositionString

Generate a unique string from the source file position information

SageInterface::declarationPreceedsDefinition

Check if a defining declaration comes before of after the non‐defining declaration.

SageInterface::deepCopyNode

Deep copy an arbitrary subtree

SageInterface::deepDelete

Deep delete a sub AST tree. It uses postorder traversal to delete each child node. Users must take care of any dangling pointers, symbols or types that result. This is identical to deleteAST()

SageInterface::deleteExpressionTreeWithOriginalExpressionSubtrees

Special purpose function for deleting AST expression tress containing valid original expression trees in constant folded expressions (for internal use only).

SageInterface::dumpInfo

Dump information about a SgNode for debugging

SageInterface::dumpPreprocInfo

Dumps a located node's preprocessing information.

SageInterface::enclosingNamespaceScope

Find the enclosing namespace of a declaration

SageInterface::findBreakStmts

Find break statements inside a particular statement, stopping at nested loops or switches loops or switch statements defines their own contexts for break statements. The function will stop immediately if run on a loop or switch statement. If fortranLabel is non‐empty, breaks (EXITs) to that label within nested loops are included in the returned list.

SageInterface::findContinueStmts

Find all continue statements inside a particular statement, stopping at nested loops Nested loops define their own contexts for continue statements. The function will stop immediately if run on a loop statement. If fortranLabel is non‐empty, continues (CYCLEs) to that label within nested loops are included in the returned list.

SageInterface::findDeclarationStatement

Topdown traverse a subtree from root to find the first declaration given its name, scope (optional, can be NULL), and defining or nondefining flag.

SageInterface::findEnclosingLoop

Find the closest loop outside the given statement; if fortranLabel is not empty, the Fortran label of the loop must be equal to it

SageInterface::findEnclosingOmpClauseBodyStatement

Find enclosing OpenMP clause body statement from s. If s is already one, return it directly.

SageInterface::findEnclosingSwitch

Find the closest switch outside a given statement (normally used for case and default statements)

SageInterface::findFunctionDeclaration

Topdown traverse a subtree from root to find the first function declaration matching the given name, scope (optional, can be NULL), and defining or nondefining flag. This is an instantiation of findDeclarationStatement<T>.

SageInterface::findMain

top‐down traversal from current node to find the main() function declaration

SageInterface::findSurroundingStatementFromSameFile

Supporting function to comment relocation in insertStatement() and removeStatement().

SageInterface::findUnusedLabels

Find unused labels which are not targets of any goto statements

SageInterface::fixStatement

A wrapper containing fixes (fixVariableDeclaration(),fixStructDeclaration(), fixLabelStatement(), etc) for all kinds statements. Should be used before attaching the statement into AST.

SageInterface::fixVariableReferences

Mostly used internally when some AST pieces are built without knowing their target scope/parent, especially during bottom‐up construction of AST. The associated symbols, parent and scope pointers cannot be set on construction then. A set of utility functions are provided to patch up scope, parent, symbol for them when the target scope/parent become know.

SageInterface::generateUniqueName

Generate unique name from C and C++ constructs. The name may contain space.

SageInterface::generateUniqueNameForUseAsIdentifier

Generate a useful name to support construction of identifiers from declarations.

SageInterface::getAssociatedType

Get the enclosing type of this associated node, not used other than in ./src/backend/unparser/nameQualificationSupport.C

SageInterface::getBoolType

Get the right bool type according to C or C++ language input

SageInterface::getDeclaredType

Returns the type introduced by a declaration.

SageInterface::getDependentDeclarations

Get a statement's dependent declarations which declares the types used in the statement. The returned vector of declaration statements are sorted according to their appearance order in the original AST. Any reference to a class or template class from a namespace will treated as a reference to the enclosing namespace.

SageInterface::getEnclosingClassDeclaration

Get the closest class declaration enclosing the specified AST node,

SageInterface::getEnclosingClassDefinition

Get the closest class definition enclosing the specified AST node,

SageInterface::getEnclosingExprListExp

Get the enclosing SgExprListExp (used as part of function argument index evaluation in subexpressions).

SageInterface::getEnclosingFileNode

get the SgFile node from current node

SageInterface::getEnclosingFunctionDeclaration

Find the enclosing function declaration, including its derived instances like isSgProcedureHeaderStatement, isSgProgramHeaderStatement, and isSgMemberFunctionDeclaration.

SageInterface::getEnclosingModuleStatement

Get the closest module statement enclosing the specified AST node,

SageInterface::getEnclosingNode

Find a node by type using upward traversal.

SageInterface::getEnclosingProcedure

Find the function definition

SageInterface::getEnclosingScope

Get the enclosing scope from a node n

SageInterface::getEnclosingSourceFile

Find enclosing source file node

SageInterface::getEnclosingStatement

Find the closest enclosing statement, including the given node

SageInterface::getGlobalScope

Traverse back through a node's parents to find the enclosing global scope

SageInterface::getLoopIndexVariable

Return the loop index variable for a for loop

SageInterface::getNextStatement

Get next statement within the same scope of current statement

SageInterface::getPreviousStatement

Get previous statement of the current statement. It may return a previous statement of a parent scope by default (climbOutScope is true), otherwise only a previous statement of the same scope is returned.

SageInterface::getProject

SageInterface::getScope

Get the closest scope from astNode. Return astNode if it is already a scope.

SageInterface::getTemplateDeclaration

Get the enclosing TemplateDeclaration statement

SageInterface::get_name

Generate a useful name to describe the SgNode

SageInterface::get_name

Generate a useful name to describe the declaration

SageInterface::get_name

Generate a useful name to describe the declaration

SageInterface::guardNode

Add preproccessor guard around a given node. It surrounds the node with "#if guard" and "#endif"

SageInterface::hasSameGlobalScope

This is supporting the recognition of functions in header files from two different ASTs

SageInterface::insertHeader

Insert a new header right before stmt, if there are existing headers attached to stmt, insert it as the last or first header as specified by asLastHeader

SageInterface::insertStatement

Insert a statement before or after the target statement within the target's scope. Move around preprocessing info automatically

SageInterface::insertStatementAfter

Insert a statement after a target statement, Move around preprocessing info automatically by default

SageInterface::insertStatementAfterLastDeclaration

Insert a statement after the last declaration within a scope. The statement will be prepended to the scope if there is no declaration statement found

SageInterface::insertStatementBefore

Insert a statement before a target statement

SageInterface::insertStatementBeforeFirstNonDeclaration

Insert a statement before the first non‐declaration statement in a scope. If the scope has no non‐declaration statements

SageInterface::insertStatementList

Insert a list of statements before or after the target statement within the

SageInterface::insertStatementListAfter

Insert a list of statements after a target statement

SageInterface::insertStatementListBefore

Insert a list of statements before a target statement

SageInterface::insideHeader

Check if a node is from a header file

SageInterface::insideSystemHeader

Check if a node is from a system header file

SageInterface::isAncestor

check if node1 is a strict ancestor of node 2. (a node is not considered its own ancestor)

SageInterface::isAssignmentStatement

Check if a SgNode _s is an assignment statement (any of =,+=,‐=,&=,/=, ˆ=, etc)

SageInterface::isBodyStatement

Check if a statement is a (true or false) body of a container‐like parent, such as For, Do‐while, switch, If, Catch, OmpBodyStmt, etc

SageInterface::isCanonicalForLoop

Check if a for‐loop has a canonical form, return loop index, bounds, step, and body if requested

SageInterface::isExtern

Check if a declaration has an "extern" modifier

SageInterface::isLastStatement

Check if a statement is the last statement within its closed scope

SageInterface::isMain

Check if a SgNode is a main() function declaration

SageInterface::isOmpStatement

Check if a node is SgOmp*Statement

SageInterface::isStatic

Check if a declaration has a "static' modifier

SageInterface::isStructDeclaration

Check if a SgNode is a declaration for a structure

SageInterface::isUnionDeclaration

Check if a SgNode is a declaration for a union

SageInterface::makeSingleStatementBodyToBlock

Make a single statement body to be a basic block. Its parent is if, while, catch, etc.

SageInterface::moveCommentsToNewStatement

Relocate comments and CPP directives from one statement to another.

SageInterface::moveDeclarationToAssociatedNamespace

Relocate the declaration to be explicitly represented in its associated namespace (required for some backend compilers to process template instantiations).

SageInterface::movePreprocessingInfo

Move preprocessing information of stmt_src to stmt_dst, Only move preprocessing information from the specified source‐relative position to a specified target position, otherwise move all preprocessing information with position information intact. The preprocessing information is appended to the existing preprocessing information list of the target node by default. Prepending is used if usePreprend is set to true. Optionally, the relative position can be adjust after the moving using dst_position.

SageInterface::moveUpPreprocessingInfo

Identical to movePreprocessingInfo(), except for the stale name and confusing order of parameters. It will be deprecated soon.

SageInterface::myRemoveStatement

A special purpose statement removal function, originally from inlinerSupport.h, Need Jeremiah's attention to refine it. Please don't use it for now.

SageInterface::normalizeArrowExpWithAddressOfLeftOperand

Convert all code within root matching the patern of (&left)‐>right, and translate them into left.right. Return the number of matches of the pattern. Be default, only transformation generated nodes will be normalized.

SageInterface::outputLocalSymbolTables

Output the local symbol tables.

SageInterface::pastePreprocessingInfo

Paste preprocessing information from a buffer to a destination node. Used in combination of cutPreprocessingInfo()

SageInterface::prependStatement

Prepend a statement to the beginning of the current scope, handling side effects as appropriate

SageInterface::prependStatement

Prepend a statement to the beginning of SgForInitStatement

SageInterface::printAST

Pretty print AST horizontally, output to std output.

SageInterface::printAST

Pretty print AST horizontally, output to a specified file, a simpiler interface than printAST2TextFile()

SageInterface::printAST2TextFile

Pretty print AST horizontally, output to a specified text file. If printType is set to false, don't print out type info.

SageInterface::printAST2TextFile

Pretty print AST horizontally, output to a specified text file. If printType is set to false, don't print out types info.

SageInterface::querySubTree

Query a subtree to get all nodes of a given type, with an appropriate downcast.

SageInterface::recordNormalizations

Record where normalization have been done so that we can preform denormalizations as required for the token‐based unparsing to generate minimal diffs.

SageInterface::recursivePrintCurrentAndParent

Recursively print current and parent nodes. used within gdb to probe the context of a node.

SageInterface::removeAllOriginalExpressionTrees

Set original expression trees to NULL for SgValueExp or SgCastExp expressions, so you can change the value and have it unparsed correctly.

SageInterface::removeConsecutiveLabels

Remove consecutive labels

SageInterface::removeJumpsToNextStatement

Remove jumps whose label is immediately after the jump. Used to clean up inlined code fragments.

SageInterface::removeLabeledGotos

Remove labeled goto statements

SageInterface::removeStatement

Remove a statement from its attach point of the AST. Automatically keep its associated preprocessing information at the original place after the removal. The statement is still in memory and it is up to the users to decide if the removed one will be inserted somewhere else or released from memory (deleteAST()).

SageInterface::removeUnusedLabels

Remove labels which are not targets of any goto statements: its child statement is also removed by default.

SageInterface::replaceStatement

Replace a statement with another. Move preprocessing information from oldStmt to newStmt if requested.

SageInterface::replaceWithPattern

Replace an anchor node with a specified pattern subtree with optional SgVariantExpression. All SgVariantExpression in the pattern will be replaced with copies of the anchor node.

SageInterface::saveToPDF

Save AST into a pdf file. Start from a node to find its enclosing file node. The entire file's AST will be saved into a pdf.

SageInterface::serialize

we have two serialize() functions, one for a single node, the other for a list of pointers

SageInterface::setExtern

Set a declaration as extern

SageInterface::setFortranNumericLabel

Set a numerical label for a Fortran statement. The statement should have a enclosing function definition already. SgLabelSymbol and SgLabelRefExp are created transparently as needed.

SageInterface::setLoopLowerBound

Set the lower bound of a loop header for (i=lb; ...)

SageInterface::setLoopStride

Set the stride(step) of a loop 's incremental expression, regardless the expression types (i+=s; i= i+s, etc)

SageInterface::setLoopUpperBound

Set the upper bound of a loop header,regardless the condition expression type. for (i=lb; i op up, ...)

SageInterface::setOneSourcePositionForTransformation

Set current node's source position as transformation generated

SageInterface::setOneSourcePositionNull

Set current node's source position as NULL

SageInterface::setSourcePosition

Set the source code positon for the current (input) node.

SageInterface::setSourcePositionAsTransformation

DQ (5/1/2012): New function with improved name.

SageInterface::setSourcePositionAtRootAndAllChildren

Set the source code positon for the subtree (including the root).

SageInterface::setSourcePositionForTransformation

Recursively set source position info(Sg_File_Info) as transformation generated

SageInterface::setStatic

Set a declaration as static

SageInterface::statementCanBeTransformed

If header file unparsing and token‐based unparsing are used, then some statements in header files used with the same name and different include syntax can't be transformed. This is currently because there is no way to generally test the resulting transformed code generated by ROSE.

SageInterface::whereAmI

Diagnostic function for tracing back through the parent list to understand at runtime where in the AST a failure happened.

SgNodeHelper::abbreviatedLocationToString

returns location (consisting of filename, line, column) Abbreviates fileName if too long, max file name length can be set

SgNodeHelper::classDeclarationNestingSequence

computes a list representing the nesting structure of classes (including structs and unions). It traverses the AST upwards and collects SgClassDeclaration(s) only. This covers nested classes, nested structs, and nested unions, and combinations of those.

SgNodeHelper::correspondingSgFunctionDefinition

this function should only be called for a node in the subtree of a SgFunctionDefinition node. For a given 'node' it determines the correspondnig functionDefinition node when searching upwards in the AST for such a SgFunctionDefinition node. It is useful as a simple lookup function from inside the AST subtree of a SgFunctionDefinition. Returns 0 if no SgFunctionDefinition is found (e.g. global scope).

SgNodeHelper::determineChildIndex

computes for a given node the index number of it from the parent. e.g. node1(node2,node3,node4) : node4 has index 2 (starting at 0) For the root node of an AST (e.g. SgProject) this function returns ‐1.

SgNodeHelper::determineVariablesInSubtree

determines all VarRefExp in the subtree of 'node'. The order in the vector corresponds to the traversal order on the AST.

SgNodeHelper::findFunctionDeclarationWithFunctionSymbol

returns the function declaration statement found for a given function symbol.

SgNodeHelper::findVariableDeclarationWithVariableSymbol

returns the declaration statement found for a given variable symbol.

SgNodeHelper::getClosestParentFunctionDefinitionOfLocatedNode

schroder3 (2016‐07‐22): Returns the closest function definition that contains the given node

SgNodeHelper::getCond

returns the root node representing the AST of the condition of If, While, DoWhile, For, CondOperator, switch.

SgNodeHelper::getExprRootChild

returns the child of SgExpressionRoot (which is guaranteed to be unique and to exist)

SgNodeHelper::getExprStmtChild

returns the child of SgExprStatement (which is guaranteed to be unique and to exist)

SgNodeHelper::getFalseBranch

returns the root node representing the AST of the false branch of If, CondOperator.

SgNodeHelper::getFirstChild

returns the first child of an arbitrary AST node (throws exception if numChildren==0)

SgNodeHelper::getFirstOfBlock

returns the first Statement of SgBasicBlock (throws exception if numChildren==0)

SgNodeHelper::getForIncExpr

returns the incr/derc‐expr of For.

SgNodeHelper::getForInitList

returns the initializer‐list of For.

SgNodeHelper::getFunctionCallActualParameterList

return a function‐call's argument list

SgNodeHelper::getFunctionDefinitionFormalParameterList

return a function‐definition's list of formal paramters

SgNodeHelper::getFunctionName

returns function name of SgFunctionDefinition, SgFunctionDeclaration, SgFunctionCall.

SgNodeHelper::getFunctionReturnType

return a function‐definition's return type

SgNodeHelper::getLabelName

returns the label name of a SgLabelStatement without trailing ":"

SgNodeHelper::getLastOfBlock

returns the last Statement of SgBasicBlock (throws exception if numChildren==0)

SgNodeHelper::getLhs

return lhs of a binary node (if it is not a binary node it throws an exception)

SgNodeHelper::getLoopBody

returns the root node representing the AST of the loop body of While, DoWhile, For.

SgNodeHelper::getParent

returns the parent of a node. Essentially a wrapper function of the ROSE get_parent() function, but throws an exception if no parent exists. For SgProject node no exception is thrown if no parent exists because it is the root node of a ROSE AST.

SgNodeHelper::getRhs

return rhs of a binary node (if it is not a binary node it throws an exception)

SgNodeHelper::getTrueBranch

returns the root node representing the AST of the true branch of If, CondOperator.

SgNodeHelper::getUnaryOpChild

returns the child of a SgUnaryExp (which is guaranteed to be unique and to exist)

SgNodeHelper::isArrayElementAssignment

checks whether the expression 'node' represents an assignment to an array's element considers all assignment operators and arrays of any size

SgNodeHelper::isAstRoot

checks whether the node 'node' is the root node of the AST by using the get_parent function.

SgNodeHelper::isCond

is true if 'node' is the root node of the AST representing the condition of If, While, DoWhile, For, switch, CondExp.

SgNodeHelper::isCondInBranchStmt

is true if 'node' is the root node of the AST representing the condition of If, While, DoWhile, For, switch.

SgNodeHelper::isCondStmt

is true if 'node' is the root node of the AST representing If, While, DoWhile, For, switch.

SgNodeHelper::isCondStmtOrExpr

is true if 'node' is the root node of the AST representing If, While, DoWhile, For, switch, CondExp.

SgNodeHelper::isForIncExpr

determines whether a node is the root node of an AST representing the inc‐expr in a SgForStatement. This function is helpful to deal with this special case in the ROSE AST where an expression does not have a root node which can be easily determined to be a root node of an expression (i.e. here it can be any binary or unary node in constrast to all other expressions in the ROSE AST which are either a SgExprStatement or have a SgExpressionRoot node.

SgNodeHelper::isForwardFunctionDeclaration

Determines whether a provided function declaration is a forward declaration

SgNodeHelper::isFunctionParameterVariableSymbol

checks whether a SgVariableSymbol is representing a function parameter (this does not apply for forward declarations)

SgNodeHelper::isLastChildOf

checks whether 'elem' is the last child (in traversal order) of node 'parent'.

SgNodeHelper::isLoopCond

is true if 'node' is the root node of the AST representing the condition of a Loop construct (While, DoWhile, For).

SgNodeHelper::isLoopStmt

is true if 'node' is the root node of the AST representing a Loop construct (While, DoWhile, For).

SgNodeHelper::isPostfixIncDecOp

returns true for Expr‐‐ and Expr‐‐, otherwise false;

SgNodeHelper::isPrefixIncDecOp

returns true for ‐‐Expr and ++Expr, otherwise false.

SgNodeHelper::isVariableSymbolInFunctionForwardDeclaration

checks whether a SgVariableSymbol is representing a variable in

SgNodeHelper::lineColumnAndSourceCodeToString

returns line, column, and unparsed node in one string.

SgNodeHelper::lineColumnPair

returns a std::pair of line and column number. If no file info exists at this node it returns (‐1,‐1).

SgNodeHelper::locationAndSourceCodeToString

returns location (consisting of filename, line, column) and source code of unparsed node in one string. Abbreviates fileName and unparsed source if too long (defaults are 30,20)

SgNodeHelper::locationToString

returns location (consisting of filename, line, column)

SgNodeHelper::loopRelevantBreakStmtNodes

returns a set of SgNode where each node is a break node, but properly excludes all nested loops.

SgNodeHelper::matchExtendedNormalizedCall

matches C and C++ function calls (also ctor and dtor)

SgNodeHelper::nodeToString

returns a string representing the node (excluding the subtree)

SgNodeHelper::numChildren

returns the number of children as int (intentionally not as t_size) ensures that the number of children fits into an int, otherwise throws exception.

SgNodeHelper::replaceAstWithString

replaces the ast with root 'node' with the string 's'. The string is attached to the AST and the unparser uses string s instead of unparsing this substree. This function can be used to generate C++ extensions.

SgNodeHelper::scopeNestingLevel

computes for a given node at which scope nesting level this node is in its AST

SgNodeHelper::scopeSequenceNumber

computes for a given node at which scope nesting level this node is in its AST

SgNodeHelper::setCond

sets 'cond' as the root node of the AST representing the condition in statements if, while, dowhile, for, switch.

SgNodeHelper::sourceFilenameLineColumnToString

returns filename+line+column information of AST fragment in format "filename:line:column". Used for generating readable output

SgNodeHelper::sourceFilenameToString

returns filename as stored in AST node. Used for generating readable output.

SgNodeHelper::sourceLineColumnToString

returns filename followed by line:column in one string. Used for generating readable output.

SgNodeHelper::sourceLineColumnToString

returns filename followed by line, separator, and column in one string. Used for generating readable output.

SgNodeHelper::switchRelevantCaseStmtNodes

collects all case labels from the switch it started in (excludes nested switch stmts). This function also works for Duff's device code where 'case' labels can be inside nested loop/if constructs.

SgNodeHelper::switchRelevantDefaultStmtNode

returns the default stmt if it exists. Otherwise return 0 and can be used to test whether a default stmt exists in a given switch stmt. This function also works for Duff's device code. code where 'default' labels can be inside nested loop/if constructs.

SgNodeHelper::uniqueLongVariableName

Creates a long unique variable name for a given node of type SgVariableDeclaration or SgVarRefExp

SgNodeHelper::unparseCond

returns the string representing the condition (removes trailing ';')

TransformationTracking::registerAstSubtreeIds

Assign Ids and save current File Info.

VirtualCFG::cfgBeginningOfConstruct

The first CFG node for a construct (before the construct starts to execute)

VirtualCFG::cfgEndOfConstruct

The last CFG node for a construct (after the entire construct has finished executing). This node may not actually be reached if, for example, a goto causes a loop to be exited in the middle

VirtualCFG::cfgIndexForEndWrapper

VirtualCFG::cfgToDot

Dump the filtered dot graph of a virtual control flow graph starting from SgNode (start)

VirtualCFG::cfgToDotForDebugging

Dump the full dot graph of a virtual control flow graph starting from SgNode (start)

VirtualCFG::interestingCfgToDot

Dump a CFG with only interesting nodes for a SgNode

VirtualCFG::makeCfg

Returns CFG node for just before start

VirtualCFG::prependToScopeStmt

* CALL‐BACK FUNCTIONS FOR cfgRWTransaction::transform() **

cfgUtils::isAssignment

/ SgExpression that is that/ assignment (effectively a type cast) or NULL otherwise

sg::ancestor

finds an ancestor node with a given type

sg::assert_sage_type

asserts that n has type SageNode

sg::assume_sage_type

unchecked down cast from SgNode to SageNode

sg::assume_sage_type

Outliner::Preprocess::createBlock

Convert the "plain‐old" statement into an SgBasicBlock. This normalization simplifies outlining of single statements.

Outliner::Preprocess::preprocessOutlineTarget

Preprocesses the outline target and returns an equivalent SgBasicBlock to outline.

SgNodeHelper::Pattern::matchAssertExpr

tests pattern for an assert

SgNodeHelper::Pattern::matchExprStmtAssignOpVarRefExpFunctionCallExp

tests pattern SgExprStatement(SgAssignOp(VarRefExp,FunctionCallExp)) and returns pointer to FunctionCallExp otherwise 0.

SgNodeHelper::Pattern::matchExprStmtFunctionCallExp

tests pattern SgExprStatement(FunctionCallExp) and returns pointer to FunctionCallExp, otherwise 0.

SgNodeHelper::Pattern::matchFunctionCall

tests several patterns and returns pointer to FunctionCallExp inside that matched pattern, otherwise 0.

SgNodeHelper::Pattern::matchFunctionCallExpInVariableDeclaration

tests pattern for function call in variable declaration and returns pointer to FunctionCallExp otherwise 0.

SgNodeHelper::Pattern::matchReturnStmtFunctionCallExp

tests pattern SgReturnStmt(FunctionCallExp) and returns pointer to FunctionCallExp, otherwise 0.

SgNodeHelper::Pattern::matchSingleVarFPrintf

tests pattern SgFunctionCall(...) where the name of the function is fprintf with 3 params

SgNodeHelper::Pattern::matchSingleVarPrintf

tests pattern SgFunctionCall(...) where the name of the function is printf with 2 params

SgNodeHelper::Pattern::matchSingleVarScanf

tests pattern SgFunctionCall(...) where the name of the function is scanf with 2 params

SgNodeHelper::Pattern::matchVariableDeclarationWithFunctionCall

checks variable declaration with function call, returns variable declaration. Otherwise 0. e.g. int x=f();

SgNodeHelper::Pattern::matchVariableDeclarationWithFunctionCall2

checks variable declaration with function call, returns both in a pair, or a with (0,0).

legacy::PRE::getFunctionDefinition

Get the function definition containing a given node

legacy::PRE::partialRedundancyElimination

Do partial redundancy elimination on all functions within the scope n.

Derived Classes

Description

Typedefs define new types for use in variable declarations, function parameter lists, etc. Typically the base type is complex and the typedef name allows the more complex types use to be made easier to read. ‐ Todo: There are a few data members in this field that don't appear to be used (should be removed if not required): ‐ p_declaration: have not seen it be used anywhere (I think it is used when a declartion is explicit in the typedef, check this out, might be part of older mechanism before defining and nondefining declarations were developed to provide a uniform mechanism for all declarations) ‐ p_parent_scope: this is a SgSymbol, but I don't know why it is stored explicitly. ‐ See also: Example of using a SgTypedefDeclaration object

Data members

#### SgName SgTypedefDeclaration::p_name This is the name of the newly defined type. ‐ Internal: This name carries no qualification.

#### SgType SgTypedefDeclaration::p_base_type This is the type being given a new name by the typedef declaration. ‐ Internal: This name can be private so using the base type directly can cause access violations within generated code.

#### SgTypedefType SgTypedefDeclaration::p_type This is the resulting type defined by the typedef declaration. This type can be used where any type can be use, declaration of variables, etc. ‐ Internal: Because of access privileges on the typedef declaration the resulting type can have access restrictions.

#### SgDeclarationStatement SgTypedefDeclaration::p_declaration pointer to the declaration (typically a SgClassDeclaration). A typedef such as "typedef struct {int __pos; int __state;} _G_fpos64_t;" defines a class as part of its declaration. p_declaration pointes to the declaration in these cases. ‐ Internal: This is the class declaration in a typedef that defines a class.

#### SgSymbol SgTypedefDeclaration::p_parent_scope This is the type symbol of the class when it is a member type (redundent with the the explicitly stored scope). This pointer almost always NULL, however test2005_188.C demonstrates a non‐NULL value. ‐ Internal: This is redundant with the explicitly stored scope. ‐ Todo: We can remove this. ‐ Deprecated: This should be removed, but and get_scope used instead.

#### bool SgTypedefDeclaration::p_typedefBaseTypeContainsDefiningDeclaration This flag indicates that the typedef defines a structure typedefExample.C This example show the definition of a struct within the typedef. ‐ Internal: I would like to give this a better name.

#### SgScopeStatement SgTypedefDeclaration::p_scope This is the scope of the typedef declaration. ‐ Internal: Comment on why we need to store the scope explicitly (resolves name qualification issues).

Member functions

#### SgTypedefDeclaration::SgTypedefDeclaration ( Sg_File_Info* startOfConstruct = NULL ) This is the constructor. This constructor builds the SgTypedefDeclaration base class. ‐ Param startOfConstruct: represents the position in the source code ‐ See also: Example:create an SgTypedefDeclaration object

#### SgTypedefDeclaration::~SgTypedefDeclaration() This is the destructor. There is nothing to delete in this object.

#### SgTypedefDeclaration::isSgTypedefDeclaration (SgNode *s) Cast function (from derived class to SgTypedefDeclaration pointer). This functions returns a SgTypedefDeclaration pointer for any input of a pointer to an object derived from a SgTypedefDeclaration. ‐ Return: Returns valid pointer to SgTypedefDeclaration if input is derived from a SgLocatedNode.

#### SgTypedefDeclaration::isSgTypedefDeclaration (const SgNode *s) Cast function (from derived class to SgTypedefDeclaration pointer). This functions returns a SgTypedefDeclaration pointer for any input of a pointer to an object derived from a SgTypedefDeclaration. ‐ Return: Returns valid pointer to SgTypedefDeclaration if input is derived from a SgLocatedNode.

#### SgTypedefDeclaration::get_scope() const Returns scope of current statement. This functions returns a pointer to the inner most SgScopeStatement where the current statement is located. This is a function called after the parents have been set. It is not called by the EDG/SAGE interface and is only called after the SAGE AST has been built and the parent pointers set within a separate phase. Improtant exception: The SgFunctionParameterList should have as it's scope the SgFunctionDefinition, but it is a sibling of the SgFunctionDefinition (both the SgFunctionParameterList and the SgFunctionDefinition have the SgFunctionDeclaration as a parent. Thus the scope of the SgFunctionParameterList is computed to be the SgGlobal (global scope) most often; which is an error). So we handle this case explicitly. ‐ Return: Returns valid pointer to SgScopeStatement.

Created with MrDocs