Name |
Description |
HasNoThrowAssign
bool HasNoThrowAssign(SgType const const* inputType);
|
|
HasNoThrowConstructor
bool HasNoThrowConstructor(SgType const const* inputType);
|
|
HasNoThrowCopy
bool HasNoThrowCopy(SgType const const* inputType);
|
|
HasTrivialAssign
bool HasTrivialAssign(SgType const const* inputType);
|
|
HasTrivialConstructor
bool HasTrivialConstructor(SgType const const* inputType);
|
|
HasTrivialCopy
bool HasTrivialCopy(SgType const const* inputType);
|
|
HasTrivialDestructor
bool HasTrivialDestructor(SgType const const* inputType);
|
|
HasVirtualDestructor
bool HasVirtualDestructor(SgType const const* inputType);
|
|
IsAbstract
bool IsAbstract(SgType const const* inputType);
|
|
IsBaseOf
bool IsBaseOf(SgType const const* inputBaseType, SgType const const* inputDerivedType);
|
|
IsClass
bool IsClass(SgType const const* inputType);
|
strip off typedef and modifer types, then check if a type is a class type, excluding union type. |
IsEmpty
bool IsEmpty(SgType const const* inputType);
|
|
IsEnum
bool IsEnum(SgType const const* inputType);
|
|
IsLiteralType
bool IsLiteralType(SgType const const* inputType);
|
|
IsPod
bool IsPod(SgType const const* inputType);
|
|
IsPolymorphic
bool IsPolymorphic(SgType const const* inputType);
|
|
IsStandardLayout
bool IsStandardLayout(SgType const const* inputType);
|
|
IsTrivial
bool IsTrivial(SgType const const* inputType);
|
|
IsUnion
bool IsUnion(SgType const const* inputType);
|
|
ReductionRecognition
void ReductionRecognition(SgForStatement* loop, std::set<std::pair<SgInitializedName*, OmpSupport::omp_construct_enum>>& results);
|
Recognize and collect reduction variables and operations within a C/C++ loop, following OpenMP 3.0 specification for allowed reduction variable types and operation types. |
UnderlyingType
SgType* UnderlyingType(SgType* type);
|
|
addDefaultConstructorIfRequired
bool addDefaultConstructorIfRequired(SgClassType* classType, int physical_file_id = Sg_File_Info::TRANSFORMATION_FILE_ID);
|
|
addMangledNameToCache
std::string addMangledNameToCache(SgNode* astNode, std::string const& mangledName);
|
|
addMessageStatement
void addMessageStatement(SgStatement* stmt, std::string message);
|
Function to add "C" style comment to statement. |
addStepToLoopBody
void addStepToLoopBody(SgScopeStatement* loopStmt, SgStatement* step);
|
Add a step statement to the end of a loop body Add a new label to the end of the loop, with the step statement after it; then change all continue statements in the old loop body into jumps to the label |
addTextForUnparser
void addTextForUnparser(SgNode* astNode, std::string s, AstUnparseAttribute::RelativePositionType inputlocation);
|
Add a string to be unparsed to support code generation for back‐end specific tools or compilers. |
addVarRefExpFromArrayDimInfo
void addVarRefExpFromArrayDimInfo(SgNode* astNode, std::vector<SgNode*>& NodeList_t);
|
Find all SgPntrArrRefExp under astNode, then add SgVarRefExp (if any) of SgPntrArrRefExp's dim_info into NodeList_t |
annotateExpressionsWithUniqueNames
void annotateExpressionsWithUniqueNames(SgProject* project);
|
Generate unique names for expressions and attach the names as persistent attributes ("UniqueNameAttribute") |
appendArg
SgVariableSymbol* appendArg(SgFunctionParameterList*, SgInitializedName*);
|
Append an argument to SgFunctionParameterList, transparently set parent,scope, and symbols for arguments when possible We recommend to build SgFunctionParameterList before building a function declaration However, it is still allowed to append new arguments for existing function declarations. |
appendExpression
void appendExpression(SgExprListExp*, SgExpression*);
|
Append an expression to a SgExprListExp, set the parent pointer also |
appendExpressionList
void appendExpressionList(SgExprListExp*, std::vector<SgExpression*> const&);
|
Append an expression list to a SgExprListExp, set the parent pointers also |
appendStatement
void appendStatement(SgStatement* stmt, SgForInitStatement* for_init_stmt);
|
appendStatement overloads
|
appendStatementList
void appendStatementList(std::vector<SgStatement*> const& stmt, SgScopeStatement* scope = NULL);
|
Append a list of statements to the end of the current scope, handle side effect of appending statements, e.g. preprocessing info, defining/nondefining pointers etc. |
appendStatementWithDependentDeclaration
void appendStatementWithDependentDeclaration(SgDeclarationStatement* decl, SgGlobal* scope, SgStatement* original_statement, bool excludeHeaderFiles);
|
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). |
astIntersection
std::vector<SgNode*> astIntersection(SgNode* original, SgNode* copy, SgCopyHelp* help = NULL);
|
Compute the intersection set for two ASTs. |
attachArbitraryText
PreprocessingInfo* attachArbitraryText(SgLocatedNode* target, std::string const& text, PreprocessingInfo::RelativePositionType position = PreprocessingInfo::before);
|
Attach an arbitrary string to a located node. A workaround to insert irregular statements or vendor‐specific attributes. |
attachComment
PreprocessingInfo* attachComment(SgLocatedNode* target, std::string const& content, PreprocessingInfo::RelativePositionType position = PreprocessingInfo::before, PreprocessingInfo::DirectiveType dtype = PreprocessingInfo::CpreprocessorUnknownDeclaration);
|
attachComment overloads
|
buildDeclarationSets
DeclarationSets* buildDeclarationSets(SgNode*);
|
|
buildForwardFunctionDeclaration
SgTemplateInstantiationMemberFunctionDecl* buildForwardFunctionDeclaration(SgTemplateInstantiationMemberFunctionDecl* memberFunctionInstantiation);
|
Generate a non‐defining (forward) declaration from a defining function declaration. |
buildFunctionPrototype
SgFunctionDeclaration* buildFunctionPrototype(SgFunctionDeclaration* functionDeclaration);
|
|
call_liveness_analysis
LivenessAnalysis* call_liveness_analysis(SgProject* project, bool debug = false);
|
Call liveness analysis on an entire project |
changeAllBodiesToBlocks
void changeAllBodiesToBlocks(SgNode* top, bool createEmptyBody = true);
|
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. |
changeBreakStatementsToGotos
void changeBreakStatementsToGotos(SgStatement* loopOrSwitch);
|
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. |
changeContinuesToGotos
void changeContinuesToGotos(SgStatement* stmt, SgLabelStatement* label);
|
Change continue statements in a given block of code to gotos to a label |
checkAccessPermissions
void checkAccessPermissions(SgNode*);
|
|
checkForInitializers
void checkForInitializers(SgNode* node);
|
|
checkSgNodePointers
void checkSgNodePointers();
|
|
checkSymbolTables
void checkSymbolTables(SgNode*);
|
|
checkTypesAreEqual
bool checkTypesAreEqual(SgType* typeA, SgType* typeB);
|
|
cleanupNontransformedBasicBlockNode
void cleanupNontransformedBasicBlockNode();
|
Remove unused basic block IR nodes added as part of normalization. |
clearMangledNameCache
void clearMangledNameCache(SgGlobal* globalScope);
|
|
clearScopeNumbers
void clearScopeNumbers(SgFunctionDefinition* functionDefinition);
|
Clears the cache of scope,integer pairs for the input function. |
clearSharedGlobalScopes
void clearSharedGlobalScopes(SgProject* project);
|
|
clearUnusedVariableSymbols
void clearUnusedVariableSymbols(SgNode* root = NULL);
|
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. |
collectModifiedLocatedNodes
std::set<SgLocatedNode*> collectModifiedLocatedNodes(SgNode* node);
|
This collects the SgLocatedNodes that are marked as modified (a flag automatically set by all set_* generated functions) (useful in debugging). |
collectModifiedStatements
std::set<SgStatement*> collectModifiedStatements(SgNode* node);
|
This collects the statements that are marked as modified (a flag automatically set by all set_* generated functions) (useful in debugging). |
collectReadOnlySymbols
void collectReadOnlySymbols(SgStatement* stmt, std::set<SgVariableSymbol*>& readOnlySymbols, bool coarseGrain = true);
|
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. |
collectReadOnlyVariables
void collectReadOnlyVariables(SgStatement* stmt, std::set<SgInitializedName*>& readOnlyVars, bool coarseGrain = true);
|
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. |
collectReadWriteRefs
bool collectReadWriteRefs(SgStatement* stmt, std::vector<SgNode*>& readRefs, std::vector<SgNode*>& writeRefs, bool useCachedDefUse = false);
|
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++ |
collectReadWriteVariables
bool collectReadWriteVariables(SgStatement* stmt, std::set<SgInitializedName*>& readVars, std::set<SgInitializedName*>& writeVars, bool coarseGrain = true);
|
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. |
collectSourceSequenceNumbers
std::set<unsigned int> collectSourceSequenceNumbers(SgNode* astNode);
|
|
collectTransformedStatements
std::set<SgStatement*> collectTransformedStatements(SgNode* node);
|
This collects the statements that are marked as transformed (useful in debugging). |
collectUseByAddressVariableRefs
void collectUseByAddressVariableRefs(SgStatement const* s, std::set<SgVarRefExp*>& varSetB);
|
Collect variable references involving use by address: including &a expression and foo(a) when type2 foo(Type& parameter) in C++ |
collectVarRefs
void collectVarRefs(SgLocatedNode* root, std::vector<SgVarRefExp*>& result);
|
Collect all variable references in a subtree |
collectVariableReferencesInArrayTypes
int collectVariableReferencesInArrayTypes(SgLocatedNode* root, std::vector<SgNode*>& currentVarRefList);
|
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]; |
computeUniqueNameForUseAsIdentifier
void computeUniqueNameForUseAsIdentifier(SgNode* astNode);
|
Traversal to set the global map of names to node and node to names.collisions to support generateUniqueNameForUseAsIdentifier() function. |
constantFolding
void constantFolding(SgNode* r);
|
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. |
containsUnknownType
bool containsUnknownType(SgType* type);
|
Check if a type (or any nested type) is unknown/incomplete. |
convertAllForsToWhiles
void convertAllForsToWhiles(SgNode* top);
|
|
convertForToWhile
void convertForToWhile(SgForStatement* f);
|
|
convertFunctionDefinitionsToFunctionPrototypes
void convertFunctionDefinitionsToFunctionPrototypes(SgNode* node);
|
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. |
convertRefToInitializedName
SgInitializedName* convertRefToInitializedName(SgNode* current, bool coarseGrain = true);
|
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. |
copyExpression
SgExpression* copyExpression(SgExpression* e);
|
Deep copy an expression |
copyStatement
SgStatement* copyStatement(SgStatement* s);
|
Deep copy a statement |
createTempVariableAndReferenceForExpression
std::pair<SgVariableDeclaration*, SgExpression*> createTempVariableAndReferenceForExpression(SgExpression* expression, SgScopeStatement* scope);
|
|
createTempVariableForExpression
std::pair<SgVariableDeclaration*, SgExpression*> createTempVariableForExpression(SgExpression* expression, SgScopeStatement* scope, bool initializeInDeclaration, SgAssignOp** reEvaluate = NULL);
|
Given an expression, generates a temporary variable whose initializer optionally evaluates that expression. Then, the var reference expression returned can be used instead of the original expression. The temporary variable created can be reassigned to the expression by the returned SgAssignOp; this can be used when the expression the variable represents needs to be evaluated. NOTE: This handles reference types correctly by using pointer types for the temporary. |
cutPreprocessingInfo
void cutPreprocessingInfo(SgLocatedNode* src_node, PreprocessingInfo::RelativePositionType pos, AttachedPreprocessingInfoType& save_buf);
|
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. |
declarationPositionString
std::string declarationPositionString(SgDeclarationStatement const* declaration);
|
Generate a unique string from the source file position information |
declarationPreceedsDefinition
bool declarationPreceedsDefinition(SgDeclarationStatement* nonDefiningDeclaration, SgDeclarationStatement* definingDeclaration);
|
Check if a defining declaration comes before of after the non‐defining declaration. |
deepCopy
template<typename NodeType> NodeType* deepCopy(NodeType const* subtree);
|
A template function for deep copying a subtree. It is also used to create deepcopy functions with specialized parameter and return types. e.g SgExpression* copyExpression(SgExpression* e); |
deepCopyNode
SgNode* deepCopyNode(SgNode const* subtree);
|
Deep copy an arbitrary subtree |
deepDelete
void deepDelete(SgNode* root);
|
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() |
deleteAST
void deleteAST(SgNode* node);
|
|
deleteExpressionTreeWithOriginalExpressionSubtrees
void deleteExpressionTreeWithOriginalExpressionSubtrees(SgNode* root);
|
Special purpose function for deleting AST expression tress containing valid original expression trees in constant folded expressions (for internal use only). |
detectCycleInType
void detectCycleInType(SgType* type, std::string const& from);
|
|
displayScope
void displayScope(SgScopeStatement* scope);
|
|
doLoopNormalization
bool doLoopNormalization(SgFortranDo* loop);
|
Normalize a Fortran Do loop. Make the default increment expression (1) explicit |
dumpInfo
void dumpInfo(SgNode* node, std::string desc = "");
|
Dump information about a SgNode for debugging |
dumpPreprocInfo
void dumpPreprocInfo(SgLocatedNode* locatedNode);
|
Dumps a located node's preprocessing information. |
enclosingNamespaceScope
SgNamespaceDefinitionStatement* enclosingNamespaceScope(SgDeclarationStatement* declaration);
|
Find the enclosing namespace of a declaration |
ensureBasicBlockAsBodyOfCaseOption
SgBasicBlock* ensureBasicBlockAsBodyOfCaseOption(SgCaseOptionStmt* cs);
|
Check if the body of a 'case option' statement is a SgBasicBlock, create one if not. |
ensureBasicBlockAsBodyOfCatch
SgBasicBlock* ensureBasicBlockAsBodyOfCatch(SgCatchOptionStmt* cos);
|
Check if the body of a 'catch' statement is a SgBasicBlock, create one if not. |
ensureBasicBlockAsBodyOfDefaultOption
SgBasicBlock* ensureBasicBlockAsBodyOfDefaultOption(SgDefaultOptionStmt* cs);
|
Check if the body of a 'default option' statement is a SgBasicBlock, create one if not. |
ensureBasicBlockAsBodyOfDoWhile
SgBasicBlock* ensureBasicBlockAsBodyOfDoWhile(SgDoWhileStmt* ws);
|
Check if the body of a 'do .. while' statement is a SgBasicBlock, create one if not. |
ensureBasicBlockAsBodyOfFor
SgBasicBlock* ensureBasicBlockAsBodyOfFor(SgForStatement* fs);
|
Check if the body of a 'for' statement is a SgBasicBlock, create one if not. |
ensureBasicBlockAsBodyOfOmpBodyStmt
SgBasicBlock* ensureBasicBlockAsBodyOfOmpBodyStmt(SgOmpBodyStatement* ompbodyStmt);
|
Check if the body of a SgOmpBodyStatement is a SgBasicBlock, create one if not |
ensureBasicBlockAsBodyOfSwitch
SgBasicBlock* ensureBasicBlockAsBodyOfSwitch(SgSwitchStatement* ws);
|
Check if the body of a 'switch' statement is a SgBasicBlock, create one if not. |
ensureBasicBlockAsBodyOfWhile
SgBasicBlock* ensureBasicBlockAsBodyOfWhile(SgWhileStmt* ws);
|
Check if the body of a 'while' statement is a SgBasicBlock, create one if not. |
ensureBasicBlockAsFalseBodyOfIf
SgBasicBlock* ensureBasicBlockAsFalseBodyOfIf(SgIfStmt* ifs, bool createEmptyBody = true);
|
Check if the false body of a 'if' statement is a SgBasicBlock, create one if not when the flag is true. |
ensureBasicBlockAsTrueBodyOfIf
SgBasicBlock* ensureBasicBlockAsTrueBodyOfIf(SgIfStmt* ifs);
|
Check if the true body of a 'if' statement is a SgBasicBlock, create one if not. |
ensureCaseInsensitiveSymbolTable
void ensureCaseInsensitiveSymbolTable(SgScopeStatement* scope, bool force_case_insensitive);
|
|
ensureSymbolParentPointers
void ensureSymbolParentPointers(SgNode* root);
|
|
eraseNullPreprocessingInfo
int eraseNullPreprocessingInfo(SgLocatedNode* lnode);
|
|
evaluateConstIntegerExpression
const_int_expr_t evaluateConstIntegerExpression(SgExpression* expr);
|
The function tries to evaluate const integer expressions (such as are used in array dimension sizes). It follows variable symbols, and requires constness. |
extractPragmaKeyword
std::string extractPragmaKeyword(SgPragmaDeclaration const*);
|
Extract a SgPragmaDeclaration's leading keyword . For example "#pragma omp parallel" has a keyword of "omp". |
findBreakStmts
std::vector<SgBreakStmt*> findBreakStmts(SgStatement* code, std::string const& fortranLabel = "");
|
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. |
findContinueStmts
std::vector<SgContinueStmt*> findContinueStmts(SgStatement* code, std::string const& fortranLabel = "");
|
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. |
findDeclarationStatement
template<typename T> T* findDeclarationStatement(SgNode* root, std::string name, SgScopeStatement* scope, bool isDefining);
|
Topdown traverse a subtree from root to find the first declaration given its name, scope (optional, can be NULL), and defining or nondefining flag. |
findEnclosingLoop
SgScopeStatement* findEnclosingLoop(SgStatement* s, std::string const& fortranLabel = "", bool stopOnSwitches = false);
|
Find the closest loop outside the given statement; if fortranLabel is not empty, the Fortran label of the loop must be equal to it |
findEnclosingOmpClauseBodyStatement
SgOmpClauseBodyStatement* findEnclosingOmpClauseBodyStatement(SgStatement* s);
|
Find enclosing OpenMP clause body statement from s. If s is already one, return it directly. |
findEnclosingSwitch
SgSwitchStatement* findEnclosingSwitch(SgStatement* s);
|
Find the closest switch outside a given statement (normally used for case and default statements) |
findFirstDefiningFunctionDecl
SgFunctionDeclaration* findFirstDefiningFunctionDecl(SgScopeStatement* scope);
|
Find the first defining function declaration statement in a scope |
findFirstSgCastExpMarkedAsTransformation
bool findFirstSgCastExpMarkedAsTransformation(SgNode* n, std::string const& s);
|
|
findFunctionDeclaration
SgFunctionDeclaration* findFunctionDeclaration(SgNode* root, std::string name, SgScopeStatement* scope, bool isDefining);
|
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>. |
findFunctionType
SgFunctionType* findFunctionType(SgType* return_type, SgFunctionParameterTypeList* typeList);
|
Find the function type matching a function signature plus a given return type |
findGotoStmts
std::vector<SgGotoStatement*> findGotoStmts(SgStatement* scope, SgLabelStatement* l);
|
|
findHeader
PreprocessingInfo* findHeader(SgSourceFile* source_file, std::string const& header_file_name, bool isSystemHeader);
|
Find the preprocessingInfo node representing #include <header.h> or #include "header.h" within a source file. Return NULL if not found. |
findLastDeclarationStatement
SgStatement* findLastDeclarationStatement(SgScopeStatement* scope, bool includePragma = false);
|
Find the last declaration statement within a scope (if any). This is often useful to decide where to insert another variable declaration statement. Pragma declarations are not treated as a declaration by default in this context. |
findMain
SgFunctionDeclaration* findMain(SgNode* currentNode);
|
top‐down traversal from current node to find the main() function declaration |
findSurroundingStatementFromSameFile
SgStatement* findSurroundingStatementFromSameFile(SgStatement* targetStmt, bool& surroundingStatementPreceedsTargetStatement);
|
Supporting function to comment relocation in insertStatement() and removeStatement(). |
findUnusedLabels
std::set<SgLabelStatement*> findUnusedLabels(SgNode* top);
|
Find unused labels which are not targets of any goto statements |
fixClassDeclaration
void fixClassDeclaration(SgClassDeclaration* classDecl, SgScopeStatement* scope);
|
Fix symbols, parent and scope pointers. Used internally within appendStatment(), insertStatement() etc when a class declaration was built without knowing its target scope. |
fixFunctionDeclaration
void fixFunctionDeclaration(SgFunctionDeclaration* stmt, SgScopeStatement* scope);
|
Fix the symbol table and set scope (only if scope in declaration is not already set). |
fixLabelStatement
void fixLabelStatement(SgLabelStatement* label_stmt, SgScopeStatement* scope);
|
Fix symbol table for SgLabelStatement. Used Internally when the label is built without knowing its target scope. Both parameters cannot be NULL. |
fixNamespaceDeclaration
void fixNamespaceDeclaration(SgNamespaceDeclarationStatement* structDecl, SgScopeStatement* scope);
|
Fix symbols, parent and scope pointers. Used internally within appendStatment(), insertStatement() etc when a namespace declaration was built without knowing its target scope. |
fixStatement
void fixStatement(SgStatement* stmt, SgScopeStatement* scope);
|
A wrapper containing fixes (fixVariableDeclaration(),fixStructDeclaration(), fixLabelStatement(), etc) for all kinds statements. Should be used before attaching the statement into AST. |
fixStructDeclaration
void fixStructDeclaration(SgClassDeclaration* structDecl, SgScopeStatement* scope);
|
Fix symbols, parent and scope pointers. Used internally within appendStatment(), insertStatement() etc when a struct declaration was built without knowing its target scope. |
fixTemplateDeclaration
void fixTemplateDeclaration(SgTemplateDeclaration* stmt, SgScopeStatement* scope);
|
Fix the symbol table and set scope (only if scope in declaration is not already set). |
fixVariableDeclaration
void fixVariableDeclaration(SgVariableDeclaration* varDecl, SgScopeStatement* scope);
|
Patch up symbol, scope, and parent information when a SgVariableDeclaration's scope is known. |
fixVariableReferences
int fixVariableReferences(SgNode* root, bool cleanUnusedSymbol = true);
|
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. |
fixupReferencesToSymbols
void fixupReferencesToSymbols(SgScopeStatement const* this_scope, SgScopeStatement* copy_scope, SgCopyHelp& help);
|
All the symbol table references in the copied AST need to be reset after rebuilding the copied scope's symbol table. |
forLoopNormalization
bool forLoopNormalization(SgForStatement* loop, bool foldConstant = true);
|
Normalize a for loop, return true if successful. Generated constants will be fold by default. |
forallMaskExpression
SgExpression* forallMaskExpression(SgForAllStatement* stmt);
|
Get the mask expression from the header of a SgForAllStatement |
functionCallExpressionPreceedsDeclarationWhichAssociatesScope
bool functionCallExpressionPreceedsDeclarationWhichAssociatesScope(SgFunctionCallExp* functionCall);
|
|
generateFileList
std::vector<SgFile*> generateFileList();
|
Returns STL vector of SgFile IR node pointers. |
generateFunctionDefinitionsList
std::vector<SgFunctionDeclaration*> generateFunctionDefinitionsList(SgNode* node);
|
|
generateProjectName
std::string generateProjectName(SgProject const* project, bool supressSuffix = false);
|
Added mechanism to generate project name from list of file names |
generateUniqueName
std::string generateUniqueName(SgNode const* node, bool ignoreDifferenceBetweenDefiningAndNondefiningDeclarations);
|
Generate unique name from C and C++ constructs. The name may contain space. |
generateUniqueNameForUseAsIdentifier
std::string generateUniqueNameForUseAsIdentifier(SgDeclarationStatement* declaration);
|
Generate a useful name to support construction of identifiers from declarations. |
generateUniqueNameForUseAsIdentifier_support
std::string generateUniqueNameForUseAsIdentifier_support(SgDeclarationStatement* declaration);
|
|
generateUniqueVariableName
std::string generateUniqueVariableName(SgScopeStatement* scope, std::string baseName = "temp");
|
Generate a name like temp# that is unique in the current scope and any parent and children scopes. # is a unique integer counter. |
getAllStatementsAtLine
void getAllStatementsAtLine(SgSourceFile* sourceFile, int line, SgStatementPtrList& returnList);
|
Obtain all the queryed statement at line of a source file |
getArrayElementCount
size_t getArrayElementCount(SgArrayType* t);
|
Calculate the number of elements of an array type: dim1* dim2*... , assume element count is 1 for int a[]. |
getArrayElementType
SgType* getArrayElementType(SgType* t);
|
Get the element type of an array. It recursively find the base type for multi‐dimension array types |
getAssociatedType
SgType* getAssociatedType(SgNode const* astNode);
|
Get the enclosing type of this associated node, not used other than in ./src/backend/unparser/nameQualificationSupport.C |
getAssociatedTypeFromFunctionTypeList
SgType* getAssociatedTypeFromFunctionTypeList(SgExpression* actual_argument_expression);
|
Get the type of the associated argument expression from the function type. |
getBoolType
SgType* getBoolType(SgNode* n);
|
Get the right bool type according to C or C++ language input |
getClassTypeChainForMemberReference
std::list<SgClassType*> getClassTypeChainForMemberReference(SgExpression* refExp);
|
|
getDeclarationOfNamedFunction
SgFunctionDeclaration* getDeclarationOfNamedFunction(SgExpression* func);
|
Given a SgExpression that represents a named function (or bound member function), return the mentioned function |
getDeclaredType
SgType* getDeclaredType(SgDeclarationStatement const* declaration);
|
Returns the type introduced by a declaration. |
getDefaultConstructor
SgMemberFunctionDeclaration* getDefaultConstructor(SgClassDeclaration* classDeclaration);
|
Get the default constructor from the class declaration |
getDefaultDestructor
SgMemberFunctionDeclaration* getDefaultDestructor(SgClassDeclaration* classDeclaration);
|
Get the default destructor from the class declaration |
getDependentDeclarations
std::vector<SgDeclarationStatement*> getDependentDeclarations(SgStatement* stmt);
|
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. |
getDimensionCount
int getDimensionCount(SgType* t);
|
Get the number of dimensions of an array type |
getElementType
SgType* getElementType(SgType* t);
|
Get the element type of an array, pointer or string, or NULL if not applicable. This function only check one level base type. No recursion. |
getEnclosingClassDeclaration
SgClassDeclaration* getEnclosingClassDeclaration(SgNode* astNode);
|
Get the closest class declaration enclosing the specified AST node, |
getEnclosingClassDefinition
SgClassDefinition* getEnclosingClassDefinition(SgNode* astnode, bool const includingSelf = false);
|
Get the closest class definition enclosing the specified AST node, |
getEnclosingExprListExp
SgExprListExp* getEnclosingExprListExp(SgNode* astNode, bool const includingSelf = false);
|
Get the enclosing SgExprListExp (used as part of function argument index evaluation in subexpressions). |
getEnclosingFileNode
SgFile* getEnclosingFileNode(SgNode* astNode);
|
get the SgFile node from current node |
getEnclosingFunctionDeclaration
SgFunctionDeclaration* getEnclosingFunctionDeclaration(SgNode* astNode, bool const includingSelf = false);
|
Find the enclosing function declaration, including its derived instances like isSgProcedureHeaderStatement, isSgProgramHeaderStatement, and isSgMemberFunctionDeclaration. |
getEnclosingFunctionDefinition
SgFunctionDefinition* getEnclosingFunctionDefinition(SgNode* astNode, bool const includingSelf = false);
|
|
getEnclosingModuleStatement
SgModuleStatement* getEnclosingModuleStatement(SgNode* astNode, bool const includingSelf = false);
|
Get the closest module statement enclosing the specified AST node, |
getEnclosingNode
template<typename NodeType> NodeType* getEnclosingNode(SgNode const* astNode, bool const includingSelf = false);
|
Find a node by type using upward traversal. |
getEnclosingProcedure
SgFunctionDefinition* getEnclosingProcedure(SgNode* n, bool const includingSelf = false);
|
Find the function definition |
getEnclosingScope
SgScopeStatement* getEnclosingScope(SgNode* n, bool const includingSelf = false);
|
Get the enclosing scope from a node n |
getEnclosingSourceFile
SgSourceFile* getEnclosingSourceFile(SgNode const* n, bool const includingSelf = false);
|
Find enclosing source file node |
getEnclosingStatement
SgStatement* getEnclosingStatement(SgNode* n);
|
Find the closest enclosing statement, including the given node |
getFirstGlobalScope
SgGlobal* getFirstGlobalScope(SgProject* project);
|
return the first global scope under current project |
getFirstInitializedName
SgInitializedName* getFirstInitializedName(SgVariableDeclaration* decl);
|
Get the first initialized name of a declaration statement |
getFirstStatement
SgStatement* getFirstStatement(SgScopeStatement* scope, bool includingCompilerGenerated = false);
|
Get the first statement within a scope, return NULL if it does not exist. Skip compiler‐generated statement by default. Count transformation‐generated ones, but excluding those which are not to be outputted in unparsers. |
getFirstStatementAtLine
SgStatement* getFirstStatementAtLine(SgSourceFile* sourceFile, int line);
|
Obtain the first queryed statement at line of a source file |
getFirstVarSym
SgVariableSymbol* getFirstVarSym(SgVariableDeclaration* decl);
|
Get the variable symbol for the first initialized name of a declaration stmt. |
getFirstVarType
SgType* getFirstVarType(SgVariableDeclaration* decl);
|
Get the data type of the first initialized name of a declaration statement |
getFirstVariable
SgInitializedName& getFirstVariable(SgVariableDeclaration& vardecl);
|
convenience function that returns the first initialized name in a list of variable declarations. |
getForLoopInformations
bool getForLoopInformations(SgForStatement* for_loop, SgVariableSymbol*& iterator, SgExpression*& lower_bound, SgExpression*& upper_bound, SgExpression*& stride);
|
|
getFrontendSpecificNodes
std::set<SgNode*> getFrontendSpecificNodes();
|
|
getFunctionDeclaration
SgFunctionDeclaration* getFunctionDeclaration(SgFunctionCallExp* functionCallExp);
|
|
getGlobalScope
SgGlobal* getGlobalScope(SgNode const* astNode);
|
Traverse back through a node's parents to find the enclosing global scope |
getInParameters
std::vector<SgInitializedName*> getInParameters(SgInitializedNamePtrList const& params);
|
Get a vector of input parameters from the function parameter list |
getInitializerOfExpression
SgInitializer* getInitializerOfExpression(SgExpression* n);
|
Get the initializer containing an expression if it is within an initializer. |
getIntegerConstantValue
unsigned long long getIntegerConstantValue(SgValueExp* expr);
|
Get the constant value from a constant integer expression; abort on everything else. Note that signed long longs are converted to unsigned. |
getLastStatement
SgStatement* getLastStatement(SgScopeStatement* scope);
|
get the last statement within a scope, return NULL if it does not exit |
getLiveVariables
void getLiveVariables(LivenessAnalysis* liv, SgForStatement* loop, std::set<SgInitializedName*>& liveIns, std::set<SgInitializedName*>& liveOuts);
|
get liveIn and liveOut variables for a for loop from liveness analysis result liv. |
getLoopBody
SgStatement* getLoopBody(SgScopeStatement* loop);
|
Routines to get and set the body of a loop |
getLoopCondition
SgStatement* getLoopCondition(SgScopeStatement* loop);
|
Routines to get the condition of a loop. It recognize While‐loop, For‐loop, and Do‐While‐loop |
getLoopIndexVariable
SgInitializedName* getLoopIndexVariable(SgNode* loop);
|
Return the loop index variable for a for loop |
getMangledNameFromCache
std::string getMangledNameFromCache(SgNode* astNode);
|
|
getNextStatement
SgStatement* getNextStatement(SgStatement* currentStmt);
|
Get next statement within the same scope of current statement |
getNonInstantiatonDeclarationForClass
SgDeclarationStatement* getNonInstantiatonDeclarationForClass(SgTemplateInstantiationMemberFunctionDecl* memberFunctionInstantiation);
|
|
getOutParameters
std::vector<SgInitializedName*> getOutParameters(SgInitializedNamePtrList const& params);
|
Get a vector of output parameters from the function parameter list |
getPreviousStatement
SgStatement* getPreviousStatement(SgStatement* currentStmt, bool climbOutScope = true);
|
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. |
getProject
SgProject* getProject();
|
Get the current SgProject IR Node. |
getScope
SgScopeStatement* getScope(SgNode const* astNode);
|
Get the closest scope from astNode. Return astNode if it is already a scope. |
getSgNodeListFromMemoryPool
template<typename NodeType> static std::vector<NodeType*> getSgNodeListFromMemoryPool();
|
Query memory pools to grab SgNode of a specified type |
getSwitchCases
std::vector<SgStatement*> getSwitchCases(SgSwitchStatement* sw);
|
|
getSymbolsUsedInExpression
std::vector<SgVariableSymbol*> getSymbolsUsedInExpression(SgExpression* expr);
|
Find referenced symbols within an expression |
getTemplateDeclaration
SgDeclarationStatement* getTemplateDeclaration(SgNode const* astNode);
|
Get the enclosing TemplateDeclaration statement |
getTemplateParameterKeyword
std::string getTemplateParameterKeyword(SgTemplateParameter* param);
|
|
getTypeName
std::string getTypeName(SgType* type);
|
Get the string representing the type name |
get_C_array_dimensions
std::vector<SgExpression*> get_C_array_dimensions(SgArrayType const& arrtype);
|
returns the array dimensions in an array as defined for arrtype |
get_name
std::string get_name(SgC_PreprocessorDirectiveStatement const* directive);
|
get_name overloads
|
guardNode
void guardNode(SgLocatedNode* target, std::string guard);
|
Add preproccessor guard around a given node. It surrounds the node with "#if guard" and "#endif" |
hasMultipleInitStatmentsOrExpressions
bool hasMultipleInitStatmentsOrExpressions(SgForStatement* for_loop);
|
Check if a for loop uses C99 style initialization statement with multiple expressions like for (int i=0, j=0; ..) or for (i=0,j=0;...) |
hasSameGlobalScope
bool hasSameGlobalScope(SgStatement* statement_1, SgStatement* statement_2);
|
This is supporting the recognition of functions in header files from two different ASTs |
hasSimpleChildrenList
bool hasSimpleChildrenList(SgScopeStatement* scope);
|
Check if a scope statement has a simple children statement list so insert additional statements under the scope is straightforward and unambiguous . for example, SgBasicBlock has a simple statement list while IfStmt does not. |
hasTemplateSyntax
bool hasTemplateSyntax(SgName const& name);
|
|
hasTrivialDestructor
bool hasTrivialDestructor(SgType* t);
|
Does a type have a trivial (built‐in) destructor? |
initializeIfStmt
void initializeIfStmt(SgIfStmt* ifstmt, SgStatement* conditional, SgStatement* true_body, SgStatement* false_body);
|
Support function used for variable declarations in conditionals |
initializeSwitchStatement
void initializeSwitchStatement(SgSwitchStatement* switchStatement, SgStatement* item_selector, SgStatement* body);
|
Support function used for variable declarations in conditionals |
initializeWhileStatement
void initializeWhileStatement(SgWhileStmt* whileStatement, SgStatement* condition, SgStatement* body);
|
Support function used for variable declarations in conditionals |
insertAfterUsingCommaOp
SgCommaOpExp* insertAfterUsingCommaOp(SgExpression* new_exp, SgExpression* anchor_exp, SgStatement temp_decl = NULL, SgVarRefExp temp_ref = NULL);
|
Insert an expression (new_exp ) after another expression (anchor_exp) has possible side effects, without changing the original semantics. This is done by using two comma operators: type T1; ... ((T1 = anchor_exp, new_exp),T1) )... , where T1 is a temp variable saving the possible side effect of anchor_exp. The top level comma op exp is returned. The reference to T1 in T1 = anchor_exp is saved in temp_ref. |
insertBeforeUsingCommaOp
SgCommaOpExp* insertBeforeUsingCommaOp(SgExpression* new_exp, SgExpression* anchor_exp);
|
Insert an expression (new_exp )before another expression (anchor_exp) has possible side effects, without changing the original semantics. This is achieved by using a comma operator: (new_exp, anchor_exp). The comma operator is returned. |
insertHeader
void insertHeader(SgStatement* stmt, PreprocessingInfo* newheader, bool asLastHeader);
|
insertHeader overloads
|
insertStatement
void insertStatement(SgStatement* targetStmt, SgStatement* newStmt, bool insertBefore = true, bool autoMovePreprocessingInfo = true);
|
Insert a statement before or after the target statement within the target's scope. Move around preprocessing info automatically |
insertStatementAfter
void insertStatementAfter(SgStatement* targetStmt, SgStatement* newStmt, bool autoMovePreprocessingInfo = true);
|
Insert a statement after a target statement, Move around preprocessing info automatically by default |
insertStatementAfterLastDeclaration
void insertStatementAfterLastDeclaration(std::vector<SgStatement*> stmt_list, SgScopeStatement* scope);
|
insertStatementAfterLastDeclaration overloads
|
insertStatementBefore
void insertStatementBefore(SgStatement* targetStmt, SgStatement* newStmt, bool autoMovePreprocessingInfo = true);
|
Insert a statement before a target statement |
insertStatementBeforeFirstNonDeclaration
void insertStatementBeforeFirstNonDeclaration(SgStatement* newStmt, SgScopeStatement* scope, bool movePreprocessingInfo = true);
|
Insert a statement before the first non‐declaration statement in a scope. If the scope has no non‐declaration statements |
insertStatementList
void insertStatementList(SgStatement* targetStmt, std::vector<SgStatement*> const& newStmts, bool insertBefore = true);
|
Insert a list of statements before or after the target statement within the |
insertStatementListAfter
void insertStatementListAfter(SgStatement* targetStmt, std::vector<SgStatement*> const& newStmt);
|
Insert a list of statements after a target statement |
insertStatementListBefore
void insertStatementListBefore(SgStatement* targetStmt, std::vector<SgStatement*> const& newStmts);
|
Insert a list of statements before a target statement |
insertStatementListBeforeFirstNonDeclaration
void insertStatementListBeforeFirstNonDeclaration(std::vector<SgStatement*> const& newStmts, SgScopeStatement* scope);
|
Insert statements before the first non‐declaration statement in a scope. If the scope has no non‐declaration statements |
insideHeader
bool insideHeader(SgLocatedNode* node);
|
Check if a node is from a header file |
insideSystemHeader
bool insideSystemHeader(SgLocatedNode* node);
|
Check if a node is from a system header file |
instrumentEndOfFunction
int instrumentEndOfFunction(SgFunctionDeclaration* func, SgStatement* s);
|
Instrument(Add a statement, often a function call) into a function right before the return points, handle multiple return statements (with duplicated statement s) and return expressions with side effects. Return the number of statements inserted. Useful when adding a runtime library call to terminate the runtime system right before the end of a program (e.g., OpenMP). Return with complex expressions with side effects are rewritten using an additional assignment statement. |
isAddressTaken
bool isAddressTaken(SgExpression* refExp);
|
|
isAncestor
bool isAncestor(SgNode* node1, SgNode* node2);
|
check if node1 is a strict ancestor of node 2. (a node is not considered its own ancestor) |
isArrayReference
bool isArrayReference(SgExpression* ref, SgExpression arrayNameExp = NULL, std::vector<SgExpression*> subscripts = NULL);
|
Check if an expression is an array access (SgPntrArrRefExp). If so, return its name expression and subscripts if requested. Users can use convertRefToInitializedName() to get the possible name. It does not check if the expression is a top level SgPntrArrRefExp. |
isAssignable
bool isAssignable(SgType* type);
|
Is a type assignable? This may not quite work properly. |
isAssignmentStatement
bool isAssignmentStatement(SgNode* _s, SgExpression lhs = NULL, SgExpression rhs = NULL, bool* readlhs = NULL);
|
Check if a SgNode _s is an assignment statement (any of =,+=,‐=,&=,/=, ˆ=, etc) |
isAstTeardownEnabled
bool isAstTeardownEnabled();
|
Returns true if AST teardown is enabled for this process. |
isBodyStatement
bool isBodyStatement(SgStatement* s);
|
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 |
isCallToParticularFunction
bool isCallToParticularFunction(SgFunctionDeclaration* decl, SgExpression* e);
|
|
isCanonicalDoLoop
bool isCanonicalDoLoop(SgFortranDo* loop, SgInitializedName ivar, SgExpression lb, SgExpression ub, SgExpression step, SgStatement** body, bool* hasIncrementalIterationSpace, bool* isInclusiveUpperBound);
|
Check if a Fortran Do loop has a complete canonical form: Do I=1, 10, 1 |
isCanonicalForLoop
bool isCanonicalForLoop(SgNode* loop, SgInitializedName ivar = NULL, SgExpression lb = NULL, SgExpression ub = NULL, SgExpression step = NULL, SgStatement** body = NULL, bool* hasIncrementalIterationSpace = NULL, bool* isInclusiveUpperBound = NULL);
|
Check if a for‐loop has a canonical form, return loop index, bounds, step, and body if requested |
isConstType
bool isConstType(SgType* t);
|
|
isConstantFalse
bool isConstantFalse(SgExpression* e);
|
Check if a bool or int constant expression evaluates to be a false value |
isConstantTrue
bool isConstantTrue(SgExpression* e);
|
Check if a bool or int constant expression evaluates to be a true value |
isCopyConstructible
bool isCopyConstructible(SgType* type);
|
Is a type copy constructible? This may not quite work properly. |
isDataMemberReference
bool isDataMemberReference(SgVarRefExp* varRefExp);
|
|
isDefaultConstructible
bool isDefaultConstructible(SgType* type);
|
Is a type default constructible? This may not quite work properly. |
isEqualToIntConst
bool isEqualToIntConst(SgExpression* e, int value);
|
Compare AST nodes, subtree, etc |
isEquivalentFunctionType
bool isEquivalentFunctionType(SgFunctionType const* lhs, SgFunctionType const* rhs);
|
Test if two types are equivalent SgFunctionType nodes. This is necessary for template function types They may differ in one SgTemplateType pointer but identical otherwise. |
isEquivalentType
bool isEquivalentType(SgType const* lhs, SgType const* rhs);
|
Test for equivalence of types independent of access permissions (private or protected modes for members of classes). |
isExtern
bool isExtern(SgDeclarationStatement* stmt);
|
Check if a declaration has an "extern" modifier |
isInSubTree
bool isInSubTree(SgExpression* subtree, SgExpression* exp);
|
|
isIndexOperator
bool isIndexOperator(SgExpression* exp);
|
Is an overloaded operator an index operator (also referred to as call or subscript operators). (e.g. X & operator()() or X & operator[]). |
isLambdaCapturedVariable
bool isLambdaCapturedVariable(SgVarRefExp* varRef);
|
check if a variable reference is this‐>a[i]inside of a lambda function |
isLambdaFunction
bool isLambdaFunction(SgFunctionDeclaration* func);
|
Check if a function declaration is a C++11 lambda function |
isLastStatement
bool isLastStatement(SgStatement* stmt);
|
Check if a statement is the last statement within its closed scope |
isLoopIndexVariable
bool isLoopIndexVariable(SgInitializedName* ivar, SgNode* subtree_root);
|
Check if a SgInitializedName is used as a loop index within a AST subtree This function will use a bottom‐up traverse starting from the subtree_root to find all enclosing loops and check if ivar is used as an index for either of them. |
isMain
bool isMain(SgNode const* node);
|
Check if a SgNode is a main() function declaration |
isMemberFunctionMemberReference
bool isMemberFunctionMemberReference(SgMemberFunctionRefExp* memberFunctionRefExp);
|
|
isMutable
bool isMutable(SgInitializedName* name);
|
True if an SgInitializedName is "mutable' (has storage modifier set) |
isNonconstReference
bool isNonconstReference(SgType* t);
|
Is this type a non‐constant reference type? (Handles typedefs correctly) |
isOmpStatement
bool isOmpStatement(SgNode*);
|
Check if a node is SgOmp*Statement |
isOverloaded
bool isOverloaded(SgFunctionDeclaration* functionDeclaration);
|
Return true if function is overloaded. |
isOverloadedArrowOperator
bool isOverloadedArrowOperator(SgExpression* expr);
|
isOverloadedArrowOperator overloads
|
isOverloadedArrowOperatorChain
bool isOverloadedArrowOperatorChain(SgExpression* expr);
|
Return true if expr is part of an overloaded operator‐> call chain. |
isPointerToNonConstType
bool isPointerToNonConstType(SgType* type);
|
Is this a pointer to a non‐const type? Note that this function will return true for const pointers pointing to non‐const types. For example, (int* const y) points to a modifiable int, so this function returns true. Meanwhile, it returns false for (int const * x) and (int const * const x) because these types point to a const int. Also, only the outer layer of nested pointers is unwrapped. So the function returns true for (const int ** y), but returns false for const (int * const * x) |
isPointerType
bool isPointerType(SgType* t);
|
Is this type a pointer type? (Handles typedefs correctly) |
isPostfixOperator
bool isPostfixOperator(SgExpression* exp);
|
Is an overloaded operator a postfix operator. (e.g. ). |
isPrefixOperator
bool isPrefixOperator(SgExpression* exp);
|
|
isPrefixOperatorName
bool isPrefixOperatorName(SgName const& functionName);
|
Check for proper names of possible prefix operators (used in isPrefixOperator()). |
isPrototypeInScope
bool isPrototypeInScope(SgScopeStatement* scope, SgFunctionDeclaration* functionDeclaration, SgDeclarationStatement* startingAtDeclaration);
|
|
isPureVirtualClass
bool isPureVirtualClass(SgType* type, ClassHierarchyWrapper const& classHierarchy);
|
Check if a class type is a pure virtual class. True means that there is at least one pure virtual function that has not been overridden. In the case of an incomplete class type (forward declaration), this function returns false. |
isReferenceType
bool isReferenceType(SgType* t);
|
Is this type a const or non‐const reference type? (Handles typedefs correctly) |
isRemovableStatement
bool isRemovableStatement(SgStatement* s);
|
|
isRestrictType
bool isRestrictType(SgType* t);
|
Is this a restrict type? |
isSameFunction
bool isSameFunction(SgFunctionDeclaration* func1, SgFunctionDeclaration* func2);
|
Check if two function declarations refer to the same one. Two function declarations are the same when they are a) identical, b) same name in C c) same qualified named and mangled name in C++. A nondefining (prototype) declaration and a defining declaration of a same function are treated as the same. |
isScalarType
bool isScalarType(SgType* t);
|
Is this a scalar type? We define the following SgType as scalar types: char, short, int, long , void, Wchar, Float, double, long long, string, bool, complex, imaginary |
isStatic
bool isStatic(SgDeclarationStatement* stmt);
|
Check if a declaration has a "static' modifier |
isStrictIntegerType
bool isStrictIntegerType(SgType* t);
|
Check if a type is an integral type, only allowing signed/unsigned short, int, long, long long./!/! There is another similar function named SgType::isIntegerType(), which allows additional types char, wchar, and bool to be treated as integer types |
isStructDeclaration
bool isStructDeclaration(SgNode* node);
|
Check if a SgNode is a declaration for a structure |
isStructType
bool isStructType(SgType* t);
|
Check if a type is a struct type (a special SgClassType in ROSE). Typedef and modifier types are not stripped off. Only direct struct type is returned as true. |
isStructurallyEquivalentAST
bool isStructurallyEquivalentAST(SgNode* tree1, SgNode* tree2);
|
|
isTemplateInstantiationFromTemplateDeclarationSatisfyingFilter
template<class T> bool isTemplateInstantiationFromTemplateDeclarationSatisfyingFilter(SgFunctionDeclaration* function, T* filter);
|
This function detects template instantiations that are relevant when filters are used. |
isTemplateInstantiationNode
bool isTemplateInstantiationNode(SgNode* node);
|
|
isUnionDeclaration
bool isUnionDeclaration(SgNode* node);
|
Check if a SgNode is a declaration for a union |
isUseByAddressVariableRef
bool isUseByAddressVariableRef(SgVarRefExp* ref);
|
Check if a variable reference is used by its address: including &a expression and foo(a) when type2 foo(Type& parameter) in C++ |
isVolatileType
bool isVolatileType(SgType* t);
|
Is this a volatile type? |
is_C99_language
bool is_C99_language();
|
|
is_CAF_language
bool is_CAF_language();
|
|
is_C_language
bool is_C_language();
|
|
is_Cuda_language
bool is_Cuda_language();
|
|
is_Cxx_language
bool is_Cxx_language();
|
|
is_Fortran_language
bool is_Fortran_language();
|
|
is_OpenCL_language
bool is_OpenCL_language();
|
|
is_OpenMP_language
bool is_OpenMP_language();
|
|
is_language_case_insensitive
bool is_language_case_insensitive();
|
|
is_mixed_C_and_Cxx_language
bool is_mixed_C_and_Cxx_language();
|
|
is_mixed_Fortran_and_C_and_Cxx_language
bool is_mixed_Fortran_and_C_and_Cxx_language();
|
|
is_mixed_Fortran_and_C_language
bool is_mixed_Fortran_and_C_language();
|
|
is_mixed_Fortran_and_Cxx_language
bool is_mixed_Fortran_and_Cxx_language();
|
|
language_may_contain_nondeclarations_in_scope
bool language_may_contain_nondeclarations_in_scope();
|
|
lastFrontEndSpecificStatement
SgStatement* lastFrontEndSpecificStatement(SgGlobal* globalScope);
|
|
lastStatementOfScopeWithTokenInfo
SgStatement* lastStatementOfScopeWithTokenInfo(SgScopeStatement* scope, std::map<SgNode*, TokenStreamSequenceToNodeMapping*>& tokenStreamSequenceMap);
|
Used to support token unparsing (when the output the trailing token sequence). |
listHeaderFiles
void listHeaderFiles(SgIncludeFile* includeFile);
|
return path prefix for subtree of include files. |
lookupClassSymbolInParentScopes
SgClassSymbol* lookupClassSymbolInParentScopes(SgName const& name, SgScopeStatement* currentScope = NULL, SgTemplateArgumentPtrList* templateArgumentList = NULL);
|
|
lookupEnumSymbolInParentScopes
SgEnumSymbol* lookupEnumSymbolInParentScopes(SgName const& name, SgScopeStatement* currentScope = NULL);
|
|
lookupFunctionSymbolInParentScopes
SgFunctionSymbol* lookupFunctionSymbolInParentScopes(SgName const& functionName, SgScopeStatement* currentScope = NULL);
|
lookupFunctionSymbolInParentScopes overloads
|
lookupNamedTypeInParentScopes
SgType* lookupNamedTypeInParentScopes(std::string const& type_name, SgScopeStatement* scope = NULL);
|
Lookup a named type based on its name, bottomup searching from a specified scope. Note name collison might be allowed for c (not C++) between typedef and enum/struct. Only the first matched named type will be returned in this case. typedef is returned as it is, not the base type it actually refers to. |
lookupNamespaceSymbolInParentScopes
SgNamespaceSymbol* lookupNamespaceSymbolInParentScopes(SgName const& name, SgScopeStatement* currentScope = NULL);
|
|
lookupNonrealSymbolInParentScopes
SgNonrealSymbol* lookupNonrealSymbolInParentScopes(SgName const& name, SgScopeStatement* currentScope = NULL, SgTemplateParameterPtrList* templateParameterList = NULL, SgTemplateArgumentPtrList* templateArgumentList = NULL);
|
|
lookupSymbolInParentScopes
SgSymbol* lookupSymbolInParentScopes(SgName const& name, SgScopeStatement* currentScope = NULL, SgTemplateParameterPtrList* templateParameterList = NULL, SgTemplateArgumentPtrList* templateArgumentList = NULL);
|
|
lookupSymbolInParentScopesIgnoringAliasSymbols
SgSymbol* lookupSymbolInParentScopesIgnoringAliasSymbols(SgName const& name, SgScopeStatement* currentScope = NULL, SgTemplateParameterPtrList* templateParameterList = NULL, SgTemplateArgumentPtrList* templateArgumentList = NULL);
|
utility functions for symbol tables |
lookupTemplateClassSymbolInParentScopes
SgTemplateClassSymbol* lookupTemplateClassSymbolInParentScopes(SgName const& name, SgTemplateParameterPtrList* templateParameterList, SgTemplateArgumentPtrList* templateArgumentList, SgScopeStatement* cscope = NULL);
|
|
lookupTemplateFunctionSymbolInParentScopes
SgFunctionSymbol* lookupTemplateFunctionSymbolInParentScopes(SgName const& functionName, SgFunctionType* ftype, SgTemplateParameterPtrList* tplparams, SgScopeStatement* currentScope = NULL);
|
|
lookupTemplateMemberFunctionSymbolInParentScopes
SgFunctionSymbol* lookupTemplateMemberFunctionSymbolInParentScopes(SgName const& functionName, SgFunctionType* ftype, SgTemplateParameterPtrList* tplparams, SgScopeStatement* currentScope = NULL);
|
|
lookupTemplateVariableSymbolInParentScopes
SgTemplateVariableSymbol* lookupTemplateVariableSymbolInParentScopes(SgName const& name, SgTemplateParameterPtrList* tplparams, SgTemplateArgumentPtrList* tplargs, SgScopeStatement* currentScope = NULL);
|
|
lookupTypedefSymbolInParentScopes
SgTypedefSymbol* lookupTypedefSymbolInParentScopes(SgName const& name, SgScopeStatement* currentScope = NULL);
|
|
lookupVariableSymbolInParentScopes
SgVariableSymbol* lookupVariableSymbolInParentScopes(SgName const& name, SgScopeStatement* currentScope = NULL);
|
|
loopCollapsing
SgExprListExp* loopCollapsing(SgForStatement* target_loop, size_t collapsing_factor);
|
|
loopInterchange
bool loopInterchange(SgForStatement* loop, size_t depth, size_t lexicoOrder);
|
Interchange/permutate a n‐level perfectly‐nested loop rooted at 'loop' using a lexicographical order number within (0,depth!). |
loopTiling
bool loopTiling(SgForStatement* loopNest, size_t targetLevel, size_t tileSize);
|
Tile the n‐level (starting from 1) loop of a perfectly nested loop nest using tiling size s |
loopUnrolling
bool loopUnrolling(SgForStatement* loop, size_t unrolling_factor);
|
Unroll a target loop with a specified unrolling factor. It handles steps larger than 1 and adds a fringe loop if the iteration count is not evenly divisible by the unrolling factor. |
makeSingleStatementBodyToBlock
SgBasicBlock* makeSingleStatementBodyToBlock(SgStatement* singleStmt);
|
Make a single statement body to be a basic block. Its parent is if, while, catch, etc. |
mangleModifierType
std::string mangleModifierType(SgModifierType* type);
|
Generated mangled modifier types, include const, volatile,according to Itanium C++ ABI. |
mangleScalarType
std::string mangleScalarType(SgType* type);
|
Generate mangled scalar type names according to Itanium C++ ABI, the input type should pass isScalarType() in ROSE |
mangleType
std::string mangleType(SgType* type);
|
Generate a mangled string for a given type based on Itanium C++ ABI |
markNodeToBeUnparsed
void markNodeToBeUnparsed(SgNode* node, int physical_file_id);
|
|
markSubtreeToBeUnparsed
void markSubtreeToBeUnparsed(SgNode* root, int physical_file_id);
|
|
markSubtreeToBeUnparsedTreeTraversal
void markSubtreeToBeUnparsedTreeTraversal(SgNode* root, int physical_file_id);
|
|
mergeAssignmentWithDeclaration
bool mergeAssignmentWithDeclaration(SgExprStatement* assign_stmt, SgVariableDeclaration* decl, bool removeAssignStmt = true);
|
Merge an assignment into its upstream declaration statement. Callers should make sure the merge is semantically correct. |
mergeDeclarationAndAssignment
bool mergeDeclarationAndAssignment(SgVariableDeclaration* decl, SgExprStatement* assign_stmt, bool removeAssignStmt = true);
|
Merge a variable assignment statement into a matching variable declaration statement. Callers should make sure the merge is semantically correct (by not introducing compilation errors). This function simply does the merge transformation, without eligibility check. |
mergeDeclarationWithAssignment
bool mergeDeclarationWithAssignment(SgVariableDeclaration* decl, SgExprStatement* assign_stmt);
|
Merge a declaration statement into a matching followed variable assignment. Callers should make sure the merge is semantically correct (by not introducing compilation errors). This function simply does the merge transformation, without eligibility check. |
moveCommentsToNewStatement
void moveCommentsToNewStatement(SgStatement* sourceStatement, std::vector<int> const& indexList, SgStatement* destinationStatement, bool destinationStatementPreceedsSourceStatement);
|
Relocate comments and CPP directives from one statement to another. |
moveDeclarationToAssociatedNamespace
void moveDeclarationToAssociatedNamespace(SgDeclarationStatement* declarationStatement);
|
Relocate the declaration to be explicitly represented in its associated namespace (required for some backend compilers to process template instantiations). |
moveForStatementIncrementIntoBody
void moveForStatementIncrementIntoBody(SgForStatement* f);
|
|
movePreprocessingInfo
void movePreprocessingInfo(SgStatement* stmt_src, SgStatement* stmt_dst, PreprocessingInfo::RelativePositionType src_position = PreprocessingInfo::undef, PreprocessingInfo::RelativePositionType dst_position = PreprocessingInfo::undef, bool usePrepend = false);
|
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. |
moveStatementsBetweenBlocks
void moveStatementsBetweenBlocks(SgBasicBlock* sourceBlock, SgBasicBlock* targetBlock);
|
moveStatementsBetweenBlocks overloads
|
moveToSubdirectory
void moveToSubdirectory(std::string directoryName, SgFile* file);
|
Move file to be generated in a subdirectory (will be generated by the unparser). |
moveUpInnerDanglingIfEndifDirective
int moveUpInnerDanglingIfEndifDirective(SgLocatedNode* lnode);
|
|
moveUpPreprocessingInfo
void moveUpPreprocessingInfo(SgStatement* stmt_dst, SgStatement* stmt_src, PreprocessingInfo::RelativePositionType src_position = PreprocessingInfo::undef, PreprocessingInfo::RelativePositionType dst_position = PreprocessingInfo::undef, bool usePrepend = false);
|
Identical to movePreprocessingInfo(), except for the stale name and confusing order of parameters. It will be deprecated soon. |
moveVariableDeclaration
void moveVariableDeclaration(SgVariableDeclaration* decl, SgScopeStatement* target_scope);
|
Move a variable declaration to a new scope, handle symbol, special scopes like For loop, etc. |
myRemoveStatement
void myRemoveStatement(SgStatement* stmt);
|
A special purpose statement removal function, originally from inlinerSupport.h, Need Jeremiah's attention to refine it. Please don't use it for now. |
normalizeArrowExpWithAddressOfLeftOperand
int normalizeArrowExpWithAddressOfLeftOperand(SgNode* root, bool transformationGeneratedOnly = true);
|
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. |
normalizeCaseAndDefaultBlocks
bool normalizeCaseAndDefaultBlocks(SgSwitchStatement* switchStmt);
|
Normalize the structure of case and default blocks within a switch statement. |
normalizeForLoopIncrement
bool normalizeForLoopIncrement(SgForStatement* loop);
|
|
normalizeForLoopInitDeclaration
bool normalizeForLoopInitDeclaration(SgForStatement* loop);
|
Normalize loop init stmt by promoting the single variable declaration statement outside of the for loop header's init statement, e.g. for (int i=0;) becomes int i_x; for (i_x=0;..) and rewrite the loop with the new index variable, if necessary |
normalizeForLoopTest
bool normalizeForLoopTest(SgForStatement* loop);
|
Normalize a for loop's test expression i<x is normalized to i<= (x‐1) and i>x is normalized to i>= (x+1) |
outputFileIds
void outputFileIds(SgNode* node);
|
|
outputGlobalFunctionTypeSymbolTable
void outputGlobalFunctionTypeSymbolTable();
|
Output function type symbols in global function type symbol table. |
outputLocalSymbolTables
void outputLocalSymbolTables(SgNode* node);
|
Output the local symbol tables. |
outputSharedNodes
void outputSharedNodes(SgNode* node);
|
|
pastePreprocessingInfo
void pastePreprocessingInfo(SgLocatedNode* dst_node, PreprocessingInfo::RelativePositionType pos, AttachedPreprocessingInfoType& saved_buf);
|
Paste preprocessing information from a buffer to a destination node. Used in combination of cutPreprocessingInfo() |
preOrderCollectPreprocessingInfo
void preOrderCollectPreprocessingInfo(SgNode* current, std::vector<PreprocessingInfo*>& infoList, int depth);
|
|
prependArg
SgVariableSymbol* prependArg(SgFunctionParameterList*, SgInitializedName*);
|
Prepend an argument to SgFunctionParameterList |
prependStatement
void prependStatement(SgStatement* stmt, SgForInitStatement* for_init_stmt);
|
prependStatement overloads
|
prependStatementList
void prependStatementList(std::vector<SgStatement*> const& stmt, SgScopeStatement* scope = NULL);
|
prepend a list of statements to the beginning of the current scope, handling side effects as appropriate |
printAST
void printAST(SgNode* node);
|
printAST overloads
|
printAST2TextFile
void printAST2TextFile(SgNode* node, std::string filename, bool printType = true);
|
printAST2TextFile overloads
|
printOutComments
void printOutComments(SgLocatedNode* locatedNode);
|
|
querySubTree
template<typename NodeType> std::vector<NodeType*> querySubTree(SgNode* top, VariantT variant =(VariantT)NodeType::static_variant);
|
Query a subtree to get all nodes of a given type, with an appropriate downcast. |
rebuildSymbolTable
void rebuildSymbolTable(SgScopeStatement* scope);
|
Regenerate the symbol table. |
recordNormalizations
void recordNormalizations(SgStatement* s);
|
Record where normalization have been done so that we can preform denormalizations as required for the token‐based unparsing to generate minimal diffs. |
recursivePrintCurrentAndParent
void recursivePrintCurrentAndParent(SgNode* n);
|
Recursively print current and parent nodes. used within gdb to probe the context of a node. |
registerAstTeardownAtExit
void registerAstTeardownAtExit();
|
Register an AST teardown handler to run at process exit if cleanup was not invoked. |
registerAstTeardownProject
void registerAstTeardownProject(SgProject* project);
|
Record a project for teardown when running exit handlers. |
removeAllOriginalExpressionTrees
void removeAllOriginalExpressionTrees(SgNode* top);
|
Set original expression trees to NULL for SgValueExp or SgCastExp expressions, so you can change the value and have it unparsed correctly. |
removeConsecutiveLabels
void removeConsecutiveLabels(SgNode* top);
|
Remove consecutive labels |
removeConst
SgType* removeConst(SgType* t);
|
Remove const (if present) from a type. stripType() cannot do this because it removes all modifiers. |
removeJumpsToNextStatement
void removeJumpsToNextStatement(SgNode*);
|
Remove jumps whose label is immediately after the jump. Used to clean up inlined code fragments. |
removeLabeledGotos
void removeLabeledGotos(SgNode* top);
|
Remove labeled goto statements |
removeStatement
void removeStatement(SgStatement* stmt, bool autoRelocatePreprocessingInfo = true);
|
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()). |
removeUnusedLabels
void removeUnusedLabels(SgNode* top, bool keepChild = false);
|
Remove labels which are not targets of any goto statements: its child statement is also removed by default. |
replaceDefiningFunctionDeclarationWithFunctionPrototype
SgFunctionDeclaration* replaceDefiningFunctionDeclarationWithFunctionPrototype(SgFunctionDeclaration* functionDeclaration);
|
|
replaceExpression
void replaceExpression(SgExpression* oldExp, SgExpression* newExp, bool keepOldExp = false);
|
Replace an expression with another, used for variable reference substitution and others. the old expression can be deleted (default case) or kept. |
replaceExpressionWithStatement
void replaceExpressionWithStatement(SgExpression* from, SageInterface::StatementGenerator* to);
|
Replace a given expression with a list of statements produced by a generator |
replaceStatement
void replaceStatement(SgStatement* oldStmt, SgStatement* newStmt, bool movePreprocessinInfo = false);
|
Replace a statement with another. Move preprocessing information from oldStmt to newStmt if requested. |
replaceSubexpressionWithStatement
void replaceSubexpressionWithStatement(SgExpression* from, SageInterface::StatementGenerator* to);
|
Similar to replaceExpressionWithStatement, but with more restrictions. Assumptions: from is not within the test of a loop or ifStmt, not currently traversing from or the statement it is in |
replaceVariableReferences
void replaceVariableReferences(SgVariableSymbol* old_sym, SgVariableSymbol* new_sym, SgScopeStatement* scope);
|
Replace all variable references to an old symbol in a scope to being references to a new symbol. |
replaceWithPattern
SgNode* replaceWithPattern(SgNode* anchor, SgNode* new_pattern);
|
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. |
reportModifiedStatements
void reportModifiedStatements(std::string const& label, SgNode* node);
|
|
resetInternalMapsForTargetStatement
void resetInternalMapsForTargetStatement(SgStatement* sourceStatement);
|
|
resetMangledNameCache
void resetMangledNameCache(SgGlobal* globalScope);
|
|
resetModifiedLocatedNodes
void resetModifiedLocatedNodes(std::set<SgLocatedNode*> const& modifiedNodeSet);
|
Use the set of IR nodes and set the isModified flag in each IR node to true. |
resetScopeNumbers
void resetScopeNumbers(SgFunctionDefinition* functionDeclaration);
|
Assigns unique numbers to each SgScopeStatement of a function. |
reset_name_collision_map
void reset_name_collision_map();
|
Reset map variables used to support generateUniqueNameForUseAsIdentifier() function. |
saveToPDF
void saveToPDF(SgNode* node);
|
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. |
scopeHasStatementsFromSameFile
bool scopeHasStatementsFromSameFile(SgScopeStatement* scope);
|
This function supports the token‐based unparsing when used with unparsing of header files to know when the scope can be unparsed via it's token stream, even though a statement from a header file may contain a transformation. returns true if there is a statement in the scope that has to be unparsed (is from the same file as the scope). returns false if the scope is empty or contains only statements associated with one or more header files. |
serialize
void serialize(SgNode* node, std::string& prefix, bool hasRemaining, std::ostringstream& out, std::string& edgeLabel);
|
we have two serialize() functions, one for a single node, the other for a list of pointers |
serialize_list
template<typename T> void serialize_list(T& plist, std::string T_name, std::string& prefix, bool hasRemaining, std::ostringstream& out, std::string& edgeLabel);
|
|
setBaseTypeDefiningDeclaration
void setBaseTypeDefiningDeclaration(SgVariableDeclaration* var_decl, SgDeclarationStatement* base_decl);
|
a better version for SgVariableDeclaration::set_baseTypeDefininingDeclaration(), handling all side effects automatically Used to have a struct declaration embedded into a variable declaration |
setExtern
void setExtern(SgDeclarationStatement* stmt);
|
Set a declaration as extern |
setFortranNumericLabel
void setFortranNumericLabel(SgStatement* stmt, int label_value, SgLabelSymbol::label_type_enum label_type = SgLabelSymbol::e_start_label_type, SgScopeStatement* label_scope = NULL);
|
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. |
setLhsOperand
void setLhsOperand(SgExpression* target, SgExpression* lhs);
|
set left hand operand for binary expressions, transparently downcasting target expressions when necessary |
setLoopBody
void setLoopBody(SgScopeStatement* loop, SgStatement* body);
|
|
setLoopCondition
void setLoopCondition(SgScopeStatement* loop, SgStatement* cond);
|
Set the condition statement of a loop, including While‐loop, For‐loop, and Do‐While‐loop. |
setLoopLowerBound
void setLoopLowerBound(SgNode* loop, SgExpression* lb);
|
Set the lower bound of a loop header for (i=lb; ...) |
setLoopStride
void setLoopStride(SgNode* loop, SgExpression* stride);
|
Set the stride(step) of a loop 's incremental expression, regardless the expression types (i+=s; i= i+s, etc) |
setLoopUpperBound
void setLoopUpperBound(SgNode* loop, SgExpression* ub);
|
Set the upper bound of a loop header,regardless the condition expression type. for (i=lb; i op up, ...) |
setOneSourcePositionForTransformation
void setOneSourcePositionForTransformation(SgNode* root);
|
Set current node's source position as transformation generated |
setOneSourcePositionNull
void setOneSourcePositionNull(SgNode* node);
|
Set current node's source position as NULL |
setOperand
void setOperand(SgExpression* target, SgExpression* operand);
|
Set operands for expressions with single operand, such as unary expressions. handle file info, lvalue, pointer downcasting, parent pointer etc. |
setParameterList
template<class actualFunction> void setParameterList(actualFunction* func, SgFunctionParameterList* paralist);
|
Set parameter list for a function declaration, considering existing parameter list etc. |
setPragma
void setPragma(SgPragmaDeclaration* decl, SgPragma* pragma);
|
Set a pragma of a pragma declaration. handle memory release for preexisting pragma, and set parent pointer. |
setRhsOperand
void setRhsOperand(SgExpression* target, SgExpression* rhs);
|
set left hand operand for binary expression |
setSourcePosition
void setSourcePosition(SgNode* node);
|
Set the source code positon for the current (input) node. |
setSourcePositionAsTransformation
void setSourcePositionAsTransformation(SgNode* node);
|
DQ (5/1/2012): New function with improved name. |
setSourcePositionAtRootAndAllChildren
void setSourcePositionAtRootAndAllChildren(SgNode* root);
|
Set the source code positon for the subtree (including the root). |
setSourcePositionForTransformation
void setSourcePositionForTransformation(SgNode* root);
|
Recursively set source position info(Sg_File_Info) as transformation generated |
setSourcePositionPointersToNull
void setSourcePositionPointersToNull(SgNode* node);
|
|
setStatic
void setStatic(SgDeclarationStatement* stmt);
|
Set a declaration as static |
setTemplateParameterKeyword
void setTemplateParameterKeyword(SgTemplateParameter* param, std::string kw);
|
|
set_name
int set_name(SgInitializedName* initializedNameNode, SgName new_name);
|
set_name of symbol in symbol table. |
skipTranslateToUseCppDeclaration
bool skipTranslateToUseCppDeclaration(PreprocessingInfo* currentPreprocessingInfo);
|
|
sortSgNodeListBasedOnAppearanceOrderInSource
std::vector<SgDeclarationStatement*> sortSgNodeListBasedOnAppearanceOrderInSource(std::vector<SgDeclarationStatement*> const& nodevec);
|
Reorder a list of declaration statements based on their appearance order in source files |
splitExpression
SgAssignInitializer* splitExpression(SgExpression* from, std::string newName = "");
|
Replace an expression with a temporary variable and an assignment statement |
splitExpressionIntoBasicBlock
void splitExpressionIntoBasicBlock(SgExpression* expr);
|
Split long expressions into blocks of statements |
splitVariableDeclaration
SgExprStatement* splitVariableDeclaration(SgVariableDeclaration* decl);
|
splitVariableDeclaration overloads
|
statementCanBeTransformed
bool statementCanBeTransformed(SgStatement* stmt);
|
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. |
suggestNextNumericLabel
int suggestNextNumericLabel(SgFunctionDefinition* func_def);
|
Suggest next usable (non‐conflicting) numeric label value for a Fortran function definition scope |
tearDownAst
void tearDownAst(SgProject* project);
|
Explicitly tear down an AST and release global caches and memory pools. AST pointers are invalid after this call. |
templateArgumentEquivalence
bool templateArgumentEquivalence(SgTemplateArgument* arg1, SgTemplateArgument* arg2);
|
Verify that 2 SgTemplateArgument are equivalent (same type, same expression, or same template declaration) |
templateArgumentListEquivalence
bool templateArgumentListEquivalence(SgTemplateArgumentPtrList const& list1, SgTemplateArgumentPtrList const& list2);
|
Verify that 2 SgTemplateArgumentPtrList are equivalent. |
templateDefinitionIsInClass
bool templateDefinitionIsInClass(SgTemplateInstantiationMemberFunctionDecl* memberFunctionDeclaration);
|
Return true if template definition is in the class, false if outside of class. |
transferSymbols
void transferSymbols(SgScopeStatement* from_scope, SgScopeStatement* to_scope, bool skip_label_symbols = true);
|
|
translateScopeToUseCppDeclarations
void translateScopeToUseCppDeclarations(SgScopeStatement* scope);
|
|
translateStatementToUseCppDeclarations
std::vector<SgC_PreprocessorDirectiveStatement*> translateStatementToUseCppDeclarations(SgStatement* statement, SgScopeStatement* scope);
|
|
translateToUseCppDeclarations
void translateToUseCppDeclarations(SgNode* n);
|
|
unnormalizeForLoopInitDeclaration
bool unnormalizeForLoopInitDeclaration(SgForStatement* loop);
|
Undo the normalization of for loop's C99 init declaration. Previous record of normalization is used to ease the reverse transformation. |
updateDefiningNondefiningLinks
void updateDefiningNondefiningLinks(SgFunctionDeclaration* func, SgScopeStatement* scope);
|
Update defining and nondefining links due to a newly introduced function declaration. Should be used after inserting the function into a scope. This function not only set the defining and nondefining links of the newly introduced function declaration inside a scope, but also update other same function declarations' links accordingly if there are any. Assumption: The function has already inserted/appended/prepended into the scope before calling this function. |
whereAmI
void whereAmI(SgNode* node);
|
Diagnostic function for tracing back through the parent list to understand at runtime where in the AST a failure happened. |
wrapAllTemplateInstantiationsInAssociatedNamespaces
void wrapAllTemplateInstantiationsInAssociatedNamespaces(SgProject* root);
|
|
wrapFunction
std::pair<SgStatement*, SgInitializedName*> wrapFunction(SgFunctionDeclaration& definingDeclaration, SgName newName);
|
wrapFunction overloads
|