SgEnumDeclaration
This class represents the concept of an enum declaration.
Synopsis
Declared in <src/docs/mrdocs/ast_node_docs.h>
class SgEnumDeclaration
: public SgDeclarationStatement
Base Classes
Name |
Description |
This class represents the concept of a declaration statement. |
Friends
Name |
Description |
|
Casts pointer from base class to derived class (for const pointers) |
|
Casts pointer from base class to derived class |
Non-Member Functions
Name |
Description |
Checks whether the physical source position information is consistant in the Sg_File_Info object |
|
Check for consistancy of isTransformation flags for nodes marked as a transformation. |
|
Combined procedure for cleaning up code after inlining. Does not do variable renaming or block flattening, however. |
|
Detect nodes marked as transformations (should not be present coming out of the frontend translation). |
|
Find all variables referenced in a region |
|
Workaround for ROSE bug. Should be used whenever expressions in a program are modified. |
|
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. |
|
Get the statement of an expression. Somewhat smarter than the standard version of this routine, but needs to be merged. |
|
Internal routine to check whether a given variable declaration is a member variable. |
|
Casts pointer from base class to derived class (for const pointers) |
|
Casts pointer from base class to derived class |
|
Casts pointer from base class to derived class (for const pointers) |
|
Casts pointer from base class to derived class |
|
Casts pointer from base class to derived class |
|
Casts pointer from base class to derived class (for const pointers) |
|
If the declaration has translation unit scope (as opposed to program scope), mangle the translation unit name. |
|
Mark relavant expressions as l‐values explicitly. |
|
Move variables declared in a for statement to just outside that statement. |
|
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 |
|
Propagate hidden list information for variables, types, and class elaboration. |
|
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. |
|
Remove all null statements (those with only an integer constant or a null expression) |
|
Remove unused variables in a scope |
|
Rename all labels in a block of code. |
|
Rename all variables in a block of code, and ensure that all variable references point to the correct declarations. |
|
Replace a child of a node. |
|
In code with declarations such as "int foo = bar", where foo and bar are not modified, replace "foo" with "bar" and remove the declaration |
|
Do a simple form of finite differencing on all functions contained within root (which should be a project, file, or function definition). |
|
This is a top level function not called recursively. |
|
Validate a fresh detached construction transaction. |
|
Validate exact parent ownership for a published AST. |
|
This is a top level function not called recursively. |
|
Append a deep‐copy of statement s onto the basic block b. |
|
Collect var syms for all local variable declarations at 's'. |
|
Collect var syms declared at 'root' or below that are visible to 'target'. |
|
Collect non‐local "goto" statements. |
|
Collect non‐local "jumps" within a statement. |
|
Collect variables suitable for using pointer dereferencing |
|
Collect var syms for all variable references at 's'. |
|
Collect 'this' expressions. |
|
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 |
|
Collect variable references using addresses for s |
|
Create a deep‐copy of an SgNode |
|
Dumps a statement's preprocessing information. |
|
Search for the first surrounding function definition. |
|
Search for the first surrounding scope that may contain a function def. |
|
Returns a non‐templated, unqualified name. |
|
Returns 'true' if this node is contained in a C99‐only project. |
|
Returns 'true' <==> 's' is the condition of some 'if' statement. |
|
Returns 'true' <==> 's' is the conditional selector of some 'switch' statement. |
|
Returns 'true' if the given declaration is a template instantiation. |
|
Returns 'true' <==> 's' is the condition of some 'while' or 'do ... while' statement. |
|
Moves 'after' preprocessing information. |
|
Moves 'before' preprocessing information. |
|
Moves preprocessingInfo of stmt2 to stmt1. |
|
Replaces one statement with another. |
|
Reset source position as transformation for the current node only |
|
|
Reset source position as transformation recursively |
Convert a node's location to a string‐friendly form. |
|
**** 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.** |
|
** 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.** |
|
**** 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.** |
|
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. |
|
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. |
|
Extracts the '#if' directive structure from a project. |
|
Locate the '#if' directive context at a node. |
|
Checks if the functionDeclaration (node) matches functionType |
|
This is the external interface of constant folding: |
|
**** |
|
**** |
|
**** |
|
**** |
|
** 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.* |
|
** 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.** |
|
** 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.** |
|
**** |
|
**** |
|
**** |
|
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.***** |
|
**** |
|
**** |
|
**** |
|
**** |
|
**** |
|
**** |
|
**** |
|
Attach a transformation‐generated OpenMP clause, assigning exact source‐order provenance when the directive came from combined syntax. |
|
Attach an OpenMP clause to directive |
|
Collect all variables from OpenMP clauses associated with an omp statement: private, reduction, etc |
|
Collect variables from given types of OpenMP clauses associated with an omp statement: private, reduction, etc |
|
Collect variables from a particular type of OpenMP clauses associated with an omp statement: private, reduction, etc |
|
A helper function to generate implicit or explicit task for either omp parallel or omp task |
|
Get OpenMP clauses from an eligible OpenMP statement |
|
Collect expression from given types of OpenMP clauses associated with an omp statement: private, reduction, etc |
|
Find an enclosing parallel region or function definition's body |
|
Check if an OpenMP statement has a clause of type vt |
|
Check whether a SgNode is inside omp target |
|
Return true when an OpenMP statement is a syntax‐only construct selector owned by a MATCH/WHEN clause rather than an executable AST statement. |
|
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 |
|
Remove one or more clauses of type vt |
|
Replace references to oldVar within root with references to newVar, return the number of references replaced. |
|
Replace variable references within root based on a map from old symbols to new symbols |
|
Replace all variable references in a set by pointers to the variable |
|
Translate omp atomic |
|
Translate omp barrier |
|
Translate omp critical |
|
Translate omp flush |
|
Translate omp for or omp do loops |
|
Translate omp master |
|
Translate omp metadirective |
|
Translate the ordered directive (not the ordered clause) |
|
Translate omp parallel |
|
Translate omp sections |
|
Translate omp simd |
|
Translate omp single |
|
Translate "omp target" |
|
Translate "omp target data" |
|
Translate omp for or omp do loops affected by the "omp target" directive, using naive 1‐to‐1 mapping Liao 1/28/2013 |
|
Translate omp for or omp do loops affected by the "omp target" directive, using a round robin‐scheduler Liao 7/10/2014 |
|
Translate omp parallel under "omp target" |
|
Translate omp task |
|
Translate omp taskwait |
|
Translate omp threadprivate |
|
Translate omp tile |
|
Translate omp unroll |
|
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 |
|
Computes the set of variables in 's' that need to be passed to the outlined routine (semantically equivalent to shared variables in OpenMP) |
|
Create a unique outlined‐function's wrapper argument name for the specified statement. |
|
Create a unique outlined‐function name for the specified statement. |
|
Generate packing (wrapping) statements for the variables to be passed |
|
Returns true iff the statement is "outlineable." |
|
Outlines the given statement. The main programming interface. |
|
Outline to a new function with the specified name, calling preprocessing internally |
|
Helper Function to process Left Hand Side of an Expression |
|
Helper Function to process Right Hand Side of an Expression |
|
get the sourceDirectory directory |
|
Functions to move to SgStatement object in SAGE III later |
|
Transfer a detached declarator‐local source scope to its exact non‐function declaration owner. The scope's declarations keep their independent semantic symbol scopes; only structural source ownership changes. |
|
Begin construction of a non‐function declaration whose TypeLoc owns nested source‐written tags. Both nodes must be fresh and the scope must be empty; finishSourceDeclaratorScopeConstruction() hard‐validates the populated source children before the declaration can be published. |
|
Build a SgBasicBlock, setting file info internally |
|
Build and attach a comment with an explicit lexical comment style. It is a wrapper of SageInterface::attachComment(). |
|
Build and attach #define XX directives, pass "#define xxx xxx" as content. |
|
Build a default option statement |
|
Build do‐while statement |
|
Build an enum, It is also a declaration statement in SAGE III |
|
Build one enum definition over an explicit canonical type identity. |
|
Build a for statement, assume none of the arguments is NULL |
|
Build if statement |
|
Build an enum first nondefining declaration, without file info |
|
Build a GNU statement expression |
|
Build a StmtDeclarationStmt |
|
Build a switch statement |
|
Build a try statement. |
|
Build while statement |
|
Error checking the inserted snippet AST. |
|
Complete a source‐declarator scope begun by beginSourceDeclaratorScopeConstruction(). Every child must have one exact nonautonomous structural role and already‐published physical provenance. |
|
Fixup any AST moved from one file two another (references to symbols, types, etc.). |
|
Sharing IR nodes requires that the file id be added to the fileIDsToUnparse held in the Sg_File_Info object. |
|
Get the nonreal declaration scope associated with a declaration (if any). |
|
Get or create the nonreal declaration scope associated with a declaration. |
|
Complete one source‐lexical declaration transaction whose builder used sourceLexicalPendingExactSource(). The declaration must still be detached and must already own exact physical source provenance. This operation publishes the lexical owner exactly once and never synthesizes or repairs source information. |
|
Enforce the construction‐time contract shared by all expression builders whose names end in _nfi: the newly allocated root must not already own any source‐position object. This validator never clears or repairs provenance. |
|
Attach a nonreal declaration scope to a declaration. |
|
DQ (9/16/2012): Added function to support setting the template arguments and setting their parents (and for any relevant declaration). |
|
DQ (9/16/2012): Added function to support setting the template parameters and setting their parents (and for any relevant declaration). |
|
Function to add "C" style comment to statement. |
|
Find all SgPntrArrRefExp under astNode, then add SgVarRefExp (if any) of SgPntrArrRefExp's dim_info into NodeList_t |
|
Append a statement to the end of SgForInitStatement |
|
Append a statement to the end of an explicit lexical scope, handling symbol and defining/nondefining links. |
|
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). |
|
Compute the intersection set for two ASTs. |
|
Build and attach a comment with an explicit lexical comment style. |
|
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. |
|
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. |
|
Change continue statements in a given block of code to gotos to a label |
|
This collects the SgLocatedNodes that are marked as modified (a flag automatically set by all set_* generated functions) (useful in debugging). |
|
This collects the statements that are marked as modified (a flag automatically set by all set_* generated functions) (useful in debugging). |
|
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. |
|
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. |
|
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++ |
|
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. |
|
This collects the statements that are marked as transformed (useful in debugging). |
|
Collect variable references involving use by address: including &a expression and foo(a) when type2 foo(Type& parameter) in C++ |
|
Collect all variable references in a subtree |
|
Collect variable references together with their exact source use sites. |
|
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]; |
|
Traversal to set the global map of names to node and node to names.collisions to support generateUniqueNameForUseAsIdentifier() function. |
|
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. |
|
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. |
|
Deep copy a statement |
|
Cut preprocessing information from a source node and save it into a buffer. Used in combination of pastePreprocessingInfo(). The cut‐paste operation is equivalent to a split movePreprocessingInfo() operation and permits the destination node to be unknown during the cut operation. |
|
Generate a unique string from the source file position information |
|
Check if a defining declaration comes before of after the non‐defining declaration. |
|
Deep copy an arbitrary subtree |
|
Deep copy an arbitrary subtree and return the copy transaction's exact original‐to‐copy identity map. Consumers must use this map instead of reconstructing correspondence from traversal order or spelling. |
|
Deep copy a frontend‐owned semantic subtree while preserving its exact source‐provenance classification. This is distinct from deepCopyNode(), which creates a new transformation output surface. |
|
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() |
|
Dump information about a SgNode for debugging |
|
Dumps a located node's preprocessing information. |
|
Find the enclosing namespace of a declaration |
|
Ensure a located node has the file‐info objects required before marking it as a transformation/output subtree. |
|
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. |
|
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. |
|
Topdown traverse a subtree from root to find the first declaration given its name, scope (optional, can be NULL), and defining or nondefining flag. |
|
Find the closest loop outside the given statement; if fortranLabel is not empty, the Fortran label of the loop must be equal to it |
|
Find enclosing OpenMP clause body statement from s. If s is already one, return it directly. |
|
Find the closest switch outside a given statement (normally used for case and default statements) |
|
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>. |
|
top‐down traversal from current node to find the main() function declaration |
|
Supporting function to comment relocation in insertStatement() and removeStatement(). |
|
Find unused labels which are not targets of any goto statements |
|
A wrapper containing fixes (fixVariableDeclaration(),fixStructDeclaration(), fixLabelStatement(), etc) for all kinds statements. Should be used before attaching the statement into AST. |
|
Generate unique name from C and C++ constructs. The name may contain space. |
|
Generate a useful name to support construction of identifiers from declarations. |
|
Get the enclosing type of this associated node, not used other than in ./src/backend/unparser/nameQualificationSupport.C |
|
Get the right bool type according to C or C++ language input |
|
Returns the type introduced by a declaration. |
|
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. |
|
Get the closest class declaration enclosing the specified AST node, |
|
Get the closest class definition enclosing the specified AST node, |
|
Get the enclosing SgExprListExp (used as part of function argument index evaluation in subexpressions). |
|
get the SgFile node from current node |
|
Find the enclosing function declaration, including its derived instances like isSgProcedureHeaderStatement, isSgProgramHeaderStatement, and isSgMemberFunctionDeclaration. |
|
Get the closest module statement enclosing the specified AST node, |
|
Find a node by type using upward traversal. |
|
Find the function definition |
|
Get the enclosing scope from a node n |
|
Find enclosing source file node |
|
Find the closest enclosing statement, including the given node |
|
Traverse back through a node's parents to find the enclosing global scope |
|
Return the loop index variable for a for loop |
|
Get next statement within the same scope of current statement |
|
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. |
|
Get the closest scope from astNode. Return astNode if it is already a scope. |
|
Get the enclosing TemplateDeclaration statement |
|
Generate a useful name to describe the SgNode |
|
Generate a useful name to describe the declaration |
|
Generate a useful name to describe the declaration |
|
Return whether every owned source position on a located node identifies one exact detached transformation surface awaiting an output owner. |
|
Return whether a declaration has exact semantic‐auxiliary ownership. A declaration whose parent is an auxiliary container must satisfy the complete reciprocal scope/container/list contract; malformed partial ownership is a hard error. |
|
Return whether one file‐info record is exact semantic‐only frontend provenance owned by |
|
This is supporting the recognition of functions in header files from two different ASTs |
|
Return whether every owned source position on a located node identifies one exact compiler‐generated, frontend‐specific semantic‐only surface. |
|
Insert a statement before or after the target statement within the target's scope. Move around preprocessing info automatically |
|
Insert a statement after a target statement, Move around preprocessing info automatically by default |
|
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 |
|
Insert a statement before a target statement |
|
Insert a statement before the first non‐declaration statement in a scope. If the scope has no non‐declaration statements |
|
Insert a list of statements before or after the target statement within the |
|
Insert a list of statements after a target statement |
|
Insert a list of statements before a target statement |
|
Check if a node is from a header file |
|
Check if a node is from a system header file |
|
check if node1 is a strict ancestor of node 2. (a node is not considered its own ancestor) |
|
Check if a SgNode _s is an assignment statement (any of =,+=,‐=,&=,/=, ˆ=, etc) |
|
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 |
|
Check if a for‐loop has a canonical form, return loop index, bounds, step, and body if requested |
|
Check if a declaration has an "extern" modifier |
|
Check if a statement is the last statement within its closed scope |
|
Check if a SgNode is a main() function declaration |
|
Check if a node is SgOmp*Statement |
|
Check if a declaration has a "static' modifier |
|
Check if a SgNode is a declaration for a structure |
|
Check if a SgNode is a declaration for a union |
|
Make a single statement body to be a basic block. Its parent is if, while, catch, etc. |
|
Relocate comments and CPP directives from one statement to another. |
|
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. |
|
A special purpose statement removal function, originally from inlinerSupport.h, Need Jeremiah's attention to refine it. Please don't use it for now. |
|
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. |
|
Output the local symbol tables. |
|
Paste preprocessing information from a buffer to a destination node. Used in combination of cutPreprocessingInfo() |
|
Normalize an attached statement into the exact lexical anchor used by a subsequent sibling insertion. |
|
Prepend a statement to the beginning of an explicit lexical scope, handling side effects as appropriate. |
|
Prepend a statement to the beginning of SgForInitStatement |
|
Pretty print AST horizontally, output to std output. |
|
Pretty print AST horizontally, output to a specified file, a simpiler interface than printAST2TextFile() |
|
Pretty print AST horizontally, output to a specified text file. If printType is set to false, don't print out type info. |
|
Pretty print AST horizontally, output to a specified text file. If printType is set to false, don't print out types info. |
|
Promote one exact semantic‐only frontend node that a transformation has rewritten into an independently emitted lexical node. The caller supplies the attached physical output owner explicitly; semantic descendants are not reclassified implicitly. |
|
Publish and validate the effective access of a declaration at its exact structural position in a C++ class definition. Fresh builder declarations may arrive with an unclassified access modifier; source‐backed declarations must already agree with the surrounding access‐label stream. |
|
Publish or validate the exact output owner for generated located nodes before a subtree crosses an attached AST mutation boundary. A physical owner publishes its exact file and occurrence. A semantic owner instead publishes detached transformation descendants as semantic‐only frontend structure and validates existing semantic descendants. |
|
Query a subtree to get all nodes of a given type, with an appropriate downcast. |
|
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. |
|
Record where normalization have been done so that we can preform denormalizations as required for the token‐based unparsing to generate minimal diffs. |
|
Recursively print current and parent nodes. used within gdb to probe the context of a node. |
|
Relocate generated descendants of an already‐published subtree through one explicit physical‐output file‐and‐occurrence transfer. Source‐spelled descendants retain their original physical provenance. Every generated position must identify priorOwner exactly; this API never infers or repairs an owner. |
|
Delete exactly owned source‐provenance trees before transforming their semantic expression owners. |
|
Remove consecutive labels |
|
Remove jumps whose label is immediately after the jump. Used to clean up inlined code fragments. |
|
Remove labeled goto statements |
|
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()). |
|
Remove labels which are not targets of any goto statements: its child statement is also removed by default. |
|
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. |
|
Replace a statement with another. Move preprocessing information from oldStmt to newStmt if requested. |
|
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. |
|
Require exact physical/include ownership before mutating a statement in a token‐unparsed header. Ambiguous or unsupported ownership is a hard error. |
|
Return the exact target ABI type used by sizeof/alignof for the context's one owning translation unit. Detached or untyped contexts are malformed. |
|
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. |
|
we have two serialize() functions, one for a single node, the other for a list of pointers |
|
Set a declaration as extern |
|
Set a numerical label for a Fortran statement in its exact program‐unit label scope. SgLabelSymbol and SgLabelRefExp are created as needed. |
|
Set the lower bound of a loop header for (i=lb; ...) |
|
Set the stride(step) of a loop 's incremental expression, regardless the expression types (i+=s; i= i+s, etc) |
|
Set the upper bound of a loop header,regardless the condition expression type. for (i=lb; i op up, ...) |
|
Set current node's source position as transformation generated |
|
Set current node's source position as NULL |
|
Classify one freshly constructed, non‐expression frontend node as semantic name/structure infrastructure. Any existing or partial source position is a producer error. |
|
Set the source code positon for the current (input) node. |
|
DQ (5/1/2012): New function with improved name. |
|
Set the source code positon for the subtree (including the root). |
|
Recursively set source position info(Sg_File_Info) as transformation generated |
|
Set a declaration as static |
|
Validate that every symbol has one exact owning symbol‐table entry. |
|
Diagnostic function for tracing back through the parent list to understand at runtime where in the AST a failure happened. |
|
returns location (consisting of filename, line, column) Abbreviates fileName if too long, max file name length can be set |
|
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. |
|
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). |
|
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. |
|
determines all VarRefExp in the subtree of 'node'. The order in the vector corresponds to the traversal order on the AST. |
|
returns the function declaration statement found for a given function symbol. |
|
returns the declaration statement found for a given variable symbol. |
|
|
schroder3 (2016‐07‐22): Returns the closest function definition that contains the given node |
returns the root node representing the AST of the condition of If, While, DoWhile, For, CondOperator, switch. |
|
returns the child of SgExpressionRoot (which is guaranteed to be unique and to exist) |
|
returns the child of SgExprStatement (which is guaranteed to be unique and to exist) |
|
returns the root node representing the AST of the false branch of If, CondOperator. |
|
returns the first child of an arbitrary AST node (throws exception if numChildren==0) |
|
returns the first Statement of SgBasicBlock (throws exception if numChildren==0) |
|
returns the incr/derc‐expr of For. |
|
returns the initializer‐list of For. |
|
return a function‐call's argument list |
|
return a function‐definition's list of formal paramters |
|
returns function name of SgFunctionDefinition, SgFunctionDeclaration, SgFunctionCall. |
|
return a function‐definition's return type |
|
returns the label name of a SgLabelStatement without trailing ":" |
|
returns the last Statement of SgBasicBlock (throws exception if numChildren==0) |
|
return lhs of a binary node (if it is not a binary node it throws an exception) |
|
returns the root node representing the AST of the loop body of While, DoWhile, For. |
|
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. |
|
return rhs of a binary node (if it is not a binary node it throws an exception) |
|
returns the root node representing the AST of the true branch of If, CondOperator. |
|
returns the child of a SgUnaryExp (which is guaranteed to be unique and to exist) |
|
checks whether the expression 'node' represents an assignment to an array's element considers all assignment operators and arrays of any size |
|
checks whether the node 'node' is the root node of the AST by using the get_parent function. |
|
is true if 'node' is the root node of the AST representing the condition of If, While, DoWhile, For, switch, CondExp. |
|
is true if 'node' is the root node of the AST representing the condition of If, While, DoWhile, For, switch. |
|
is true if 'node' is the root node of the AST representing If, While, DoWhile, For, switch. |
|
is true if 'node' is the root node of the AST representing If, While, DoWhile, For, switch, CondExp. |
|
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. |
|
Determines whether a provided function declaration is a forward declaration |
|
checks whether a SgVariableSymbol is representing a function parameter (this does not apply for forward declarations) |
|
checks whether 'elem' is the last child (in traversal order) of node 'parent'. |
|
is true if 'node' is the root node of the AST representing the condition of a Loop construct (While, DoWhile, For). |
|
is true if 'node' is the root node of the AST representing a Loop construct (While, DoWhile, For). |
|
returns true for Expr‐‐ and Expr‐‐, otherwise false; |
|
returns true for ‐‐Expr and ++Expr, otherwise false. |
|
checks whether a SgVariableSymbol is representing a variable in |
|
returns line, column, and unparsed node in one string. |
|
returns a std::pair of line and column number. If no file info exists at this node it returns (‐1,‐1). |
|
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) |
|
returns location (consisting of filename, line, column) |
|
returns a set of SgNode where each node is a break node, but properly excludes all nested loops. |
|
matches C and C++ function calls (also ctor and dtor) |
|
returns a string representing the node (excluding the subtree) |
|
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. |
|
computes for a given node at which scope nesting level this node is in its AST |
|
computes for a given node at which scope nesting level this node is in its AST |
|
sets 'cond' as the root node of the AST representing the condition in statements if, while, dowhile, for, switch. |
|
returns filename+line+column information of AST fragment in format "filename:line:column". Used for generating readable output |
|
returns filename as stored in AST node. Used for generating readable output. |
|
returns filename followed by line:column in one string. Used for generating readable output. |
|
returns filename followed by line, separator, and column in one string. Used for generating readable output. |
|
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. |
|
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. |
|
Creates a long unique variable name for a given node of type SgVariableDeclaration or SgVarRefExp |
|
returns the string representing the condition (removes trailing ';') |
|
Assign Ids and save current File Info. |
|
The first CFG node for a construct (before the construct starts to execute) |
|
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 |
|
Dump the filtered dot graph of a virtual control flow graph starting from SgNode (start) |
|
Dump the full dot graph of a virtual control flow graph starting from SgNode (start) |
|
Dump a CFG with only interesting nodes for a SgNode |
|
Returns CFG node for just before start |
|
* CALL‐BACK FUNCTIONS FOR cfgRWTransaction::transform() ** |
|
/ SgExpression that is that/ assignment (effectively a type cast) or NULL otherwise |
|
finds an ancestor node with a given type |
|
asserts that n has type SageNode |
|
unchecked down cast from SgNode to SageNode |
|
Convert the "plain‐old" statement into an SgBasicBlock. This normalization simplifies outlining of single statements. |
|
Preprocesses the outline target and returns an equivalent SgBasicBlock to outline. |
|
tests pattern for an assert |
|
|
tests pattern SgExprStatement(SgAssignOp(VarRefExp,FunctionCallExp)) and returns pointer to FunctionCallExp otherwise 0. |
tests pattern SgExprStatement(FunctionCallExp) and returns pointer to FunctionCallExp, otherwise 0. |
|
tests several patterns and returns pointer to FunctionCallExp inside that matched pattern, otherwise 0. |
|
|
tests pattern for function call in variable declaration and returns pointer to FunctionCallExp otherwise 0. |
tests pattern SgReturnStmt(FunctionCallExp) and returns pointer to FunctionCallExp, otherwise 0. |
|
tests pattern SgFunctionCall(...) where the name of the function is fprintf with 3 params |
|
tests pattern SgFunctionCall(...) where the name of the function is printf with 2 params |
|
tests pattern SgFunctionCall(...) where the name of the function is scanf with 2 params |
|
|
checks variable declaration with function call, returns variable declaration. Otherwise 0. e.g. int x=f(); |
|
checks variable declaration with function call, returns both in a pair, or a with (0,0). |
Get the function definition containing a given node |
|
Do partial redundancy elimination on all functions within the scope n. |
Description
‐ See also: Example of using a SgEnumDeclaration object
Data members
#### SgEnumDeclaration::p_name Name of enum type (empty if not named).
#### SgEnumDeclaration::p_embedded Boolean value true if embedded in a typedef declaration (might not be used).
#### SgEnumDeclaration::p_type SgEnumType generated by this enum declaration.
#### SgEnumDeclaration::p_enumerators STL list of pointers to SgInitializedName object (used for enum variables).
#### SgEnumDeclaration::p_scope Scope of enum declaration. Note that the scope of the enum must be stored explicitly since it can be declared in a namespace and defined outside the namespace (note that forward declarations of enum types.
Member functions
#### SgEnumDeclaration::SgEnumDeclaration ( Sg_File_Info* startOfConstruct = NULL ) This is the constructor. This constructor builds the SgEnumDeclaration base class. ‐ Param startOfConstruct: represents the position in the source code
#### SgEnumDeclaration::~SgEnumDeclaration() This is the destructor. There are a lot of things to delete, but nothing is deleted in this destructor.
#### SgEnumDeclaration::isSgEnumDeclaration (SgNode *s) Cast function (from derived class to SgEnumDeclaration pointer). This functions returns a SgEnumDeclaration pointer for any input of a pointer to an object derived from a SgEnumDeclaration. ‐ Return: Returns valid pointer to SgEnumDeclaration if input is derived from a SgLocatedNode.
#### SgEnumDeclaration::isSgEnumDeclaration (const SgNode *s) Cast function (from derived class to SgEnumDeclaration pointer). This functions returns a SgEnumDeclaration pointer for any input of a pointer to an object derived from a SgEnumDeclaration. ‐ Return: Returns valid pointer to SgEnumDeclaration if input is derived from a SgLocatedNode.
#### SgEnumDeclaration::get_name() const Access function for p_name. ‐ Return: Returns SgName by value.
#### SgEnumDeclaration::set_name(SgName name) Access function for p_name. ‐ Return: Returns void.
#### SgEnumDeclaration::get_embedded() const Access function for p_embedded. ‐ Return: Returns bool by value.
#### SgEnumDeclaration::set_embedded(bool embedded) Access function for p_embedded. ‐ Return: Returns void.
#### SgEnumDeclaration::get_type() const Access function for p_type. ‐ Return: Returns pointer to SgType.
#### SgEnumDeclaration::set_type(SgType* type) Access function for p_type. ‐ Return: Returns void.
#### SgEnumDeclaration::get_enumerators() const Access function for p_enumerators. ‐ Return: Returns a const reference to SgInitializedNamePtrList.
#### SgEnumDeclaration::get_enumerators() Access function for p_enumerators. ‐ Return: Returns reference to SgInitializedNamePtrList.
#### SgEnumDeclaration::get_scope() const Access function for p_scope. ‐ Return: Returns pointer to SgScopeStatement.
#### SgEnumDeclaration::set_scope(SgScopeStatment* scope) Access function for p_scope. ‐ Return: Returns void.
Created with MrDocs