Global namespace
Namespaces
Name |
Description |
Inherited attribute for AstQuery class. |
|
Command line processing utility functions. Functions in this namespace are in the ROSE Utilities library and |
|
Bit‐wise operations on integers. |
|
Types and functions to support OpenMP |
|
This is a mechanism for reporting statistical data about the AST, subtrees, and IR nodes. |
|
High level SAGE III AST node and subtree builders. |
|
Functions that are useful when operating on the AST. |
|
This namespace contains template functions that operate on the ROSE AST |
|
Types
Name |
Description |
Class holding static data and functions supporting File I/O. |
|
Inherited attribute required for AddPrototypesForTemplateInstantiations class. |
|
Helper class to hold Alias Information |
|
A struct to hold the information about an alias node |
|
An interface to a single annotation item |
|
*QY: Interface classes used by loop optimizations** |
|
Base class for all IR node attribute values. |
|
** |
|
Stores named attributes in Sage IR nodes. |
|
Attribute evaluator for synthesized attributes. |
|
AstCycleTest is based on the successor information of SgNodes (the same information that is used by the traversals). It tests such that it allows a preorder traversal to revisit nodes but reports an error if the traversal would run into a cycle. If a cycle is found it reports the list of SgNodes that are part of the cycle to stdout, starting with "CYCLE FOUND: ..." and stops testing. Usage: AstCycleTest t; t.traverse(SgNode* n); // where n is the root node of the subtree to be tested. |
|
AST Diagnostics |
|
provides an abstract interface to access/modify AST nodes. |
|
Statistics about IR nodes used. |
|
This is the base class for anyone who wants to be notified when AST nodes are being copied. |
|
AST Processing |
|
AST Properties (Consistency Tests) |
|
Attribute containing a regex expression as a string. |
|
/////////////////////////////////////////////////////////////////////////////////////// |
|
/////////////////////////////////////////////////////////////////////////////////////// |
|
/////////////////////////////////////////////////////////////////////////////////////// |
|
/////////////////////////////////////////////////////////////////////////////////////// |
|
Attribute storing an SgNode. |
|
Class for traversing the AST. |
|
Attribute evaluator for inherited and synthesized attributes. |
|
Attribute evaluator for inherited attributes. |
|
IR node attribute that stores a copyable value. |
|
This is a mechanism for reporting warnings about the AST, subtrees, and IR nodes. |
|
|
|
*** Commonly used lattices **** |
|
Simplifies development of queries on the AST resulting in a single boolean value. |
|
Basic type layout engine ‐‐ handles bookkeeping, plus handing typedefs and |
|
Translator from Clang AST to SAGE III (ROSE Compiler AST) |
|
A descriptor with begin(left) and end(right) characters, such as {x}, (x), etc |
|
Helper class to collect Alias Relations |
|
A pair of items separated by 'sep' |
|
A Shared Pointer Wrapper for CompactRepresentation |
|
Layout generator for customized primitive types. |
|
Backend Cxx Code Generator |
|
** |
|
stl graph class for directed and undirected graphs |
|
** |
|
dot file representation with subgraphs |
|
Extended dependence matrix: |
|
There sould not be any IR nodes marked as a transformation coming from the legacy frontend/ROSE translation. This test enforces this. |
|
a parameter with a named range of values. parameter:range_name:lower_bound:upper_bound |
|
This normalization makes sure each function call argument is a side‐effect free expression of only one variable. To accomplish this, temporary variables are declared and the arguments of a function are evaluated before the function itself. Note: Normalization is not performed if it is unsafe. E,g.: while(Foo(Bar()) {} is not equal to t = Bar(); while(Foo(t) {} Note that only SgFunctionCall arguments are normalized. For example the arguments of the constructor initializer MyObject o(foo(), bar()) will not be extracted. |
|
Initialize the definingDeclaration and firstNondefiningDeclaration pointers in SgDeclarationStatement consistantly for all declarations. Also fixup special case of multiple forward declaration where only the first one (the firstNondefiningDeclaration) get a valid pointer to the defining declaration if it exists. |
|
This traversal uses the Memory Pool traversal to fixup the enum declarations referenced in the enum values (SgEnumVal). |
|
This traversal uses the Memory Pool traversal to fixup the friend specifications on all declarations. |
|
Inherited attribute required for FixupFunctionDefaultArguments class. |
|
Modified const double variable initialized in‐class to be static const double with initializer. |
|
Inherited attribute required for FixupInitializers class. |
|
Fixup known ways in which inlcude files are used to initialized variable. |
|
Fixup pointers in the AST that user's may have left as NULL, but should not be NULL. |
|
This traversal uses inherited attributes to fixup the variables put into the AST that match the function name (a legacy frontend quirk to signal that the variable name is "*PRETTY_FUNCTION*"). |
|
Fixup known macros that reference themselves and cause recursive macro expansion in the generated (unparsed) code. |
|
This traversal uses the Memory Pool traversal to fixup the source position constructs. |
|
Fixup the storage access of all compiler‐generated forward declarations (non‐defining declarations) to match that of the defining declaration. |
|
Recognize and eliminate redundent calls to the same casting operator (or constructor initializer) |
|
Backend Fortran Code Generator |
|
Stores a function call expression, along with associated information about its context. |
|
Traverses a given AST and finds all function calls in the order in which they're evaluated Also, for each function we find where to put declarations of temporary variables so that they're accessible at the function call |
|
Layout generator for i386 primitive types |
|
Slight modification for Visual Studio ‐‐ doubles are 8‐byte aligned |
|
Support for initialization of explicit scopes (located only at specific IR nodes). |
|
* Dataflow Analyses ** |
|
Apply an analysis A's transfer function at a particular AST node type |
|
IntraProcedurial DataFlow Analysis to compute exit and entry from all the function which |
|
Struct containing a filtering function to determine what CFG nodes are interesting during the DefUse traversal. This is a functor. |
|
Backend Java Code Generator |
|
Visits live expressions ‐ helper to LiveDeadVarsTransfer |
|
Backend Language Independent Code Generator |
|
*QY: Singular interface class which remembers configurations for loop optimizations** |
|
Mark an AST subtree as compiler generated (used for instatiated templates generated by ROSE as specializations). |
|
Supporting traversal to mark an backend specific functions as compiler generated. |
|
Mark an AST subtree as compiler generated and to be output in the source file (code generation phase). |
|
Explicitly mark lhs operands of specific operators as lvalues. |
|
Mark any template instatiations that are overloaded (we can't output these since g++ can't resolve them). |
|
Mark an AST subtree to be unparsed using an alternative file (for multi‐file unparsing). |
|
Class implementing template instantiation details in Sage III. |
|
|
Inherited attribute required for MarkTemplateSpecializationsForOutputSupport class. |
|
Synthesized attribute required for MarkTemplateSpecializationsForOutputSupport class. |
Inherited attribute required for MarkTemplateSpecializationsForOutput class. |
|
Inherited attribute required for MarkTemplateSpecializationsForOutput class. |
|
Attribute corresponding to a metric. |
|
Inherited attribute for NameQuery class. |
|
* NodeFact * A fact associated with a CFG node by * some analysis thatis not evolved as part * of a dataflow analysis (i.e. it should * stay constant throughout the analysis). ** |
|
Inherited attribute for NodeQuery class. |
|
Layout generator for i386 ABI‐like struct layout |
|
This traversal uses the Memory Pool traversal to fixup the lists of typedef using this base type. |
|
Inherited attribute for NumberQuery class. |
|
Representation for an operator (function) |
|
Representation for function parameter names and types. |
|
Abstract interface for a pattern which can match ASTs |
|
A rule which changes one pattern of code to another |
|
For preprocessing information including source comments, include , if, define, etc |
|
Interface class for processing each AstNode from within the ReadAstTraverse function. |
|
Inherited attribute required for hidden list propagation to child scopes. |
|
PtrAliasAnalysis computes Alias Information, which is used for Virtual Function Resolving. |
|
ROSE HPCToolkit Module |
|
ROSE‐HPCT examples |
|
ROSE 3rd Party Libraries |
|
Inlining Transformations |
|
ROSE Frontend Group |
|
ROSE Program Transformations |
|
An interface to read into type(class) and operator(function) annotations |
|
This traversal uses the Memory Pool traversal to fixup names of template classes that appear in constructor preinitialization lists. |
|
This traversal uses the Memory Pool traversal to fixup names ofdeclarations that are inconsistant (e.g SgclassDeclarations). |
|
This traversal uses the Memory Pool traversal to fixup remaining parent pointers in Sg_File_Info objects. |
|
This traversal uses the Memory Pool traversal to fixup names ofdeclarations that are inconsistant (e.g SgclassDeclarations). |
|
This traversal implements the mechanism to reset all parent pointers (back edges in the AST graph) |
|
This traversal uses the Memory Pool traversal to fixup remaining parent pointers. |
|
Inherited attribute required for ResetParentPointers class. |
|
This traversal implements the mechanism to reset all parent pointers (back edges in the AST graph) |
|
Sets names of template classes. |
|
This traversal uses the Memory Pool traversal to fixup types indeclarations that can be shared but are not. (e.g SgclassDeclarations). |
|
AST Rewrite fragment identification traversal |
|
AST Rewrite Mechanism |
|
AST Rewrite nested classes |
|
Definition of a rewrite rule on a given SgNode. The rule modifies the node and/or its children in‐place, and then returns true for success or false for failure. |
|
Combine several rules into one, doing the constituents in order |
|
Interface for iterating over an AST. |
|
Sage III Intermediate Representation |
|
Sage III Expression Classes |
|
Sage III Statement Classes |
|
Sage III Symbol Classes |
|
Sage III Type Classes |
|
* SaveDotAnalysis ** |
|
Similar to CollectPair, but the second item may start with 'sel' without 'sep' in front of it. |
|
RHS of an array variable declaration with optional assignment. |
|
Binary AST block node. |
|
This class represents the concept of a C Assembler statement. |
|
This class represents the rhs of a variable declaration which includes an optional |
|
This class represents the concept of a block (not a basic block from control flow analysis). |
|
This class represents the base class for all IR nodes supporting the binary |
|
This class represents the notion of a binary operator. |
|
This class represents a boolean value (expression value). |
|
This class represents the notion of a break statement |
|
This class represents the concept of a generic call expression. |
|
This class represents the concept of a C and C++ case option (used within a switch statement). |
|
This class represents a cast of one type to another. |
|
This class represents the concept of a catch within a try‐catch construct used in |
|
This class represents the concept of a C++ sequence of catch statements. |
|
This class represents the concept of a class declaration statement. It includes the |
|
This class represents the concept of a class definition in C++. |
|
This class represents the concept of a C++ expression built from a class name. |
|
This class represents the concept of a class name within the compiler. |
|
This class represents the concept of a C style |
|
This class represents the concept of a C trinary conditional expression (e.g. "test ? true : false") |
|
This class represents the call of a class constructor to initialize a variable. |
|
This class represents the concept of a C or C++ continue statement. |
|
This class represents the concept of a contructor initializer list (used in |
|
This class represents modifiers for SgDeclaration (declaration statements). |
|
This class represents the concept of a declaration statement. |
|
This class represents the concept of a C or C++ default case within a switch |
|
This class represents the concept of a C++ call to the delete operator. |
|
This class represents a directory within a projects file structure of files and directories. |
|
This class represents the concept of a do‐while statement. |
|
This class represents the notion of an value (expression value). |
|
This class represents the concept of an enum declaration. |
|
This class represents the concept of the dynamic execution of a string, |
|
This class represents the concept of a C and C++ expression list. |
|
This class represents the concept of a C or C++ statement which contains a |
|
This class represents the notion of an expression. Expressions |
|
This class represents a source file for a project (which may contian |
|
This class represents the notion of an value (expression value). |
|
This class represents the variable declaration or variable initialization withn a |
|
This class represents the concept of a for loop. |
|
This class represents the concept of a C++ function call (which is an expression). |
|
This class represents the concept of a function declaration statement. |
|
This class represents the concept of a scope in C++ (e.g. global scope, fuction scope, etc.). |
|
This class represents the concept of a declaration list. |
|
This class represents the function being called and must be assembled in the |
|
This class represents a type for all functions. |
|
This class represents the concept of a name and a type. It may be |
|
This class represents the function type table (stores all function types so that |
|
This class represents the concept of a namespace definition. |
|
This class represents the concept of a C or C++ goto statement. |
|
This class represents the concept of an "if" construct. |
|
This class represents the notion of a declared variable. |
|
This class represents the notion of an initializer for a variable declaration or |
|
This class represents the physical disequality (often called pointer disequality) operator |
|
This class represents the physical equality (often called pointer equality) operator |
|
This class represents the concept of a C or C++ label statement. |
|
This class represents a lambda expression. |
|
This class represents a list display. |
|
This class represents the notion of an expression or statement which |
|
This class represents the notion of an value (expression value). |
|
This class represents the concept of a member function declaration statement. |
|
This class represents the member function being called and must be assembled in the |
|
This class represents the numeric negation of a value. Not to |
|
This class represents the base class of a number of IR nodes define modifiers |
|
This class is not used in ROSE, but is intended to represent a list of SgModifierTypes |
|
This class represents strings within the IR nodes. |
|
This class represents the concept of a C++ namespace alias declaration statement. |
|
This class represents the concept of a C++ namespace declaration. |
|
This class represents the concept of a namespace definition. |
|
This class represents the concept of a namespace name within the compiler. |
|
This class represents the notion of an n‐ary boolean operation. |
|
This class represents the notion of an n‐ary comparison operation. |
|
This class represents the notion of an n‐ary operator. |
|
This class represents the concept of a C++ call to the new operator. |
|
This class represents the base class for all IR nodes within Sage III. |
|
This class represents an object used to initialize the unparsing. |
|
This class represents a Fortran pointer assignment. It is not |
|
This class represents the concept of a C Assembler statement (untested). |
|
This class represents a source project, with a list of SgFile objects and global |
|
This class represents the concept of a 'global' stmt in Python |
|
This class represents a OLD concept of the structure require |
|
This class represents a OLD concept of the structure require |
|
This class represents the "&" operator (applied to any lvalue). |
|
This class represents the concept of a C Assembler statement (untested). |
|
This class was part of CC++ support from a long time ago. |
|
This class represents the concept of a scope in C++ (e.g. global scope, fuction scope, etc.). |
|
This class represents the "sizeof()" operator (applied to any type). |
|
This class is part of the older CC++ concept. It is not a part of C or C++ (this IR |
|
This class represents the notion of a statement. |
|
This class represents the GNU extension "statement expression" (thus is |
|
This class is intended to be a wrapper around SgStatements, allowing |
|
This class represents modifiers specific to storage. |
|
This class represents the conversion of an arbitrary expression to |
|
This class represents the base class of a numbr of IR nodes that don't otherwise fit |
|
This class represents the concept of a switch. |
|
This class represents the concept of a name within the compiler. |
|
This class represents the symbol tables used in both SgScopeStatement and |
|
This class represents template argument within the use of a template to build an instantiation. |
|
This class represents the concept of a template declaration. |
|
This class represents the concept of an instantiated class template. |
|
This class represents the concept of a class definition in C++. |
|
This class represents the concept of a C++ template instantiation directive. |
|
This class represents the concept of an instantiation of function template. |
|
This class represents the concept of an instantiation of member function template |
|
This class represents the "this" operator (can be applied to any member data). |
|
This class represents the C++ throw expression (handled as a unary operator). |
|
Temporary traversal base class (do not use). |
|
This class represents the concept of try statement within the try‐catch |
|
This class represents a tuple display. |
|
This class represents the base class for all types. |
|
This class represents a C99 complex type. |
|
This class represents a default type used for some IR nodes (see below). |
|
This class represents a C99 complex type. |
|
This class represents a string type used for SgStringVal IR node. |
|
This class represents the notion of a typedef declaration. |
|
This class represents a list of associated typedefs for the SgType IR nodes which |
|
This class represents the notion of a unary operator. |
|
This class represents the concept of a C++ using declaration. |
|
This class represents the concept of a C++ using directive. |
|
This class represents the notion of an value (expression value). |
|
This class represents the variable refernece in expressions. |
|
This class represents the concept of a C or C++ variable declaration. |
|
This class represents the definition (initialization) of a variable. |
|
This class represents the concept of a variable name within the compiler (a |
|
This class represents the concept of a do‐while statement. |
|
This class represents the location of the code associated with the IR node in the |
|
This provides some simple support mechanisms to create a graph of SimpleDirectedGraphNodes. |
|
This is a node in the directed graph. All the connectivity information for the graph is captured in this (by way of the successor and predecessor sets). |
|
|
|
|
|
A descriptor for an identifier |
|
Support for cross compilation or customized primitive type layouts. |
|
A symbolic function declaration with |
|
A list of symbolic function declarations, separated by ',', enclosed in '(..)' |
|
A list of parameter descriptors, separated by ',', enclosed in '(..)' |
|
SymbolicVal with I/O interface |
|
* Symbolic Operator interface ** |
|
Layout generator for the native system (uses sizeof) |
|
Taint Flow Analysis****** |
|
A pointer to a vertex of the static taint lattice. |
|
This traversal uses the Memory Pool traversal to test parent pointers. |
|
This tests the first non‐defining, referenced from each declaration, to make sure that it is not a forward declaration (a non‐defining declaration marked to be a forward declaration). |
|
|
|
This traversal uses the Memory Pool traversal to test declarations and if their associated symbol can be located. |
|
This traversal uses the Memory Pool traversal to test parent pointers. |
|
**** This is the graph to store the result of transitive analysis. An object of this class is passed as argument to construct a GraphTransAnalysis operator, and as we invoke GraphTransAnalysis::ComputeTransInfo to compute transitive info between nodes of the input graph, the transitive info is stored into TransInfoGraph by calling TransInfoGraph::SetTransInfo. Users of GraphTransAnalysis must implement all three virtual functions defined TransInfoGraph, to record and return transitive information already computed. The template paramter T is the type of transitive information (the result of transitive analysis). It models information regarding transitive paths in the input graph |
|
Interface class for processing each AstNode from within the TransformAstTraverse function. |
|
A map storing types and their descriptors, the descriptor could be any instantiated types as a template class. |
|
Backend C and C++ code generator. |
|
*** UnstructuredPassInterDataflow * The trivial inter‐procedural dataflow where a intra‐procedural * dataflow analysis is executed once on every function in the * application, with no guarantees about how dataflow information * is transmitted across function calls. **** |
|
UnstructuredPassAnalyses * |
|
Class holding a unique name for a variable. Is attached to varRefs as a persistent attribute. This is used to assign absolute names to VarRefExp nodes during VariableRenaming. |
|
Class that defines an VariableRenaming of a program |
|
Virutal Function Analysis and PointerAliasAnalysis are dependent on each other for their accuracy. That's why they are done together |
|
Output interface of a container |
|
Layout generator for x86‐64 primitive types |
|
Slight modification for Visual Studio ‐‐ long is 4 bytes, not 8 |
|
* affineInequalityFact ** |
|
Description of AST Diagnostics within ROSE |
|
AST construction |
|
Working with attributes |
|
Backend C and C++ Code Generator |
|
Binary analysis main page |
|
Binary analysis tutorial |
|
Boolean Query Library |
|
A function object to filter out builtin functions in a call graph (only non‐builtin functions will be considered) |
|
Writing Git commit messages |
|
Default constructors and destructors |
|
Library developers and collaborators |
|
A function object to be used as a predicate to filter out functions in a call graph: it does not filter out anything. |
|
High level AST builders |
|
Ownership of heap‐allocated objects |
|
How to install Zlib * Instructions for installing Zlib, a ROSE software dependency. */ struct installation_dependencies_zlib {}; ` |
|
Library general principles |
|
Local Node Query Library |
|
Name Query Library |
|
Node Query Library |
|
* numCallersAnnotator * Annotates every function's SgFunctionDefinition * node with a numCallersAttribute that contains the * number of functions that call the given function. **** |
|
** printDataflowInfoPass * Prints out the dataflow information associated * with a given analysis for every CFG node a * function. ***** |
|
Query Library |
|
Backend |
|
Frontend |
|
ROSE overview |
|
Midend |
|
Subtree Query Library |
|
Developing ROSE‐based tools |
|
Build systems |
|
Developing ROSE‐based tools |
|
Transformation Support Library |
|
General Utility Functions |
|
Mandatory logging are those critial msgs of the runtime including three levels of severity: MLOG_LEVEL_WARN: warning of likely problem, but the results might be ok MLOG_LEVEL_ERROR: error of runtime execution, program can continue, results will be wrong, but still useful MLOG_LEVEL_FATAL: fatal errors of runtime, program cannot continue. |
|
a set of names separated by ',', begin with '(', end with ')' |
|
A container of std::list<> of elment of NameGroup type |
|
Paramter names |
|
Parameter types |
|
Instance types for type annotations |
|
utility functions to operate on the AST. |
|
Enums
Name |
Description |
Mandatory logging are those critial msgs of the runtime including three levels of severity: MLOG_LEVEL_WARN: warning of likely problem, but the results might be ok MLOG_LEVEL_ERROR: error of runtime execution, program can continue, results will be wrong, but still useful MLOG_LEVEL_FATAL: fatal errors of runtime, program cannot continue. |
|
Functions
Name |
Description |
This does all post‐processing fixup and translation of the Sage III AST. |
|
Generate a dot graph named 'fileName' from a call graph |
|
Traverse an entire AST, where op is invoked on each AST node to gather information. |
|
Traverse and transform an entire AST, where op is invoked to transform each sub‐Tree. |
|
Optional init functions, mostly used for working with omni RTL |
|
Fixups transformations that have added template instantiations or caused template instantiations to be output so that there is a proper prototype declaration before the template instantation is called. |
|
Change all members in a program to be public. There should really be a smarter procedure for this that only changes members used by inlined code. |
|
Checks whether appropriate nodes of an AST are marked as compiler‐generated. |
|
Checks whether appropriate nodes of an AST are marked as front‐end specific. |
|
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. |
|
Convert something like "int a = foo();" into "int a; a = foo();" |
|
A helper function to copy a mapped variable from src to desc |
|
Detect nodes marked as transformations (should not be present coming out of the frontend translation). |
|
Do finite differencing on one expression within one context. The expression must be defined and valid within the entire body of root. The rewrite rules are used to simplify expressions. When a variable var is updated from old_value to new_value, an expression of the form (var, (old_value, new_value)) is created and rewritten. The rewrite rules may either produce an arbitrary expression (which will be used as‐is) or one of the form (var, (something, value)) (which will be changed to (var = value)). |
|
Main inliner code. Accepts a function call as a parameter, and inlines only that single function call. Returns true if it succeeded, and false otherwise. The function call must be to a named function, static member function, or non‐virtual non‐static member function, and the function must be known (not through a function pointer or member function pointer). Also, the body of the function must already be visible. Recursive procedures are handled properly (when allowRecursion is set), by inlining one copy of the procedure into itself. Any other restrictions on what can be inlined are bugs in the inliner code. |
|
|
|
Are two expressions equal (using a deep comparison)? |
|
Are corresponding expressions in two lists equal (using a deep comparison)? |
|
* The function void filterGraph(_GraphStructure& graph, _NodePredicate _nodePred) will filter out all nodes which satisfy the criteria which makes_NodePredicate return 'true'. NodePredicate is any function object that takes a_GraphStructure::Node as a paramater and returns a bool. In order for this to work a function_GraphStructure::DeleteNode must be implemented in order to Delete the nodes. This exact function is implemented asprotected in IDGraphCreateTemplate so it should be easy.* |
|
Get all variable names declared within a scope, in the correct order for destruction |
|
Returns the function definition containing the specified statement. |
|
Find the path of a ROSE support file from the build tree. |
|
Find the path of a ROSE support file from the source tree. |
|
Find all variables referenced in a region |
|
Workaround for ROSE bug. Should be used whenever expressions in a program are modified. |
|
Fixup all SgDeclarationStatement to have a consistant scope (between the defining and all non‐defining declarations). |
|
Fixup all SgDeclarationStatement references to defining and non‐defining declarations. |
|
Fixup global and local symbol tables. |
|
Fixup C++ symbol tables to use aliasing symbols for using declarations. |
|
Fixup definingDeclaration and firstNondefiningDeclaration pointers in SgDeclarationStatement. |
|
Checks and fixes up inconsistanties in the settings of Sg_File_Info flags (e.g. isTransformation flag) in the Sg_File_Info object |
|
Fixup Fortran array vs. function references. |
|
Fixup Fortran Use declarations. |
|
Fixup the names used build the global function symbol table. |
|
Fixup specific pointers in the AST that we would like to not have be NULL. |
|
Fixup known macros that reference themselves and cause recursive macro expansion in the generated (unparsed) code. |
|
Fixup the storage access of all compiler‐generated forward declarations (non‐defining declarations) to match that of the defining declaration. |
|
Fixups template specializations generated by ROSE from template instantiations. |
|
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. |
|
|
|
A standard set of algebraic rules for simple optimizations |
|
A standard set of algebraic and finite‐differencing rules |
|
Returns a unique positive integer ID to an SgScopeStatement within a function definition. |
|
Get the topmost enclosing expression of a given expression. Needs to be moved. |
|
Get the statement of an expression. Somewhat smarter than the standard version of this routine, but needs to be merged. |
|
A global function for getting the string associated with an enum (which is defined in global scope) |
|
returns the name of type t |
|
Does expression expr potentially have its address taken somewhere in the tree pointed to by root? |
|
Initialize explicit scopes (support function should not be called). |
|
Initialize explicit scopes (located only at specific IR nodes). |
|
Insert Fortran "CONTAINS" statement. |
|
Internal routine to check whether a given variable declaration is a member variable. |
|
Is expression expr potentially modified (assigned to, address taken, passed by non‐const reference) somewhere in the tree pointed to by root? |
|
|
|
|
|
|
|
Joins two sets of mangled qualifiers to form a new mangled qualifier. |
|
Joins two sets of mangled qualifiers to form a new mangled qualifier. |
|
Utility function to make CFG Edges |
|
Mangles a constant expression, needed for template arguments. |
|
Returns a mangled form of a C++ function name, as an SgName object. |
|
Returns a mangled form of special C++ function names (excl. qualifiers). |
|
Produces a mangled name for a scope statement. |
|
Mangles a chain of qualifiers, returning an SgName object. |
|
Mangles a chain of qualifiers followed from a given scope. |
|
Mangles a boolean expression. |
|
|
|
|
|
Mangles an instantiated template function or member function, returning a SgName object. |
|
Mangles an instantiated template function or template member function. |
|
|
|
If the declaration has translation unit scope (as opposed to program scope), mangle the translation unit name. |
|
Mangles a list of types, returning an SgName object. |
|
Mangles a container of types, returning an STL std::string object. |
|
Mangles a value expression, as used in a template argument. |
|
Mark an AST subtree as compiler generated (used for instatiated templates generated by ROSE as specializations). |
|
Mark an backend specific functions as compiler generated. |
|
Mark an AST subtree as compiler generated and to be output in the source file (code generation phase). |
|
Mark relavant expressions as l‐values explicitly. |
|
Mark any template instatiations that are overloaded (we can't output these since g++ can't resolve them). |
|
Mark an AST subtree to be unparsed using an alternative file (for multi‐file unparsing). |
|
Fixups template instantiations generated by ROSE from template declarations. |
|
Fixups transformations (which are often marked at a high level and need to be marked properly through their subtree). |
|
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 |
|
Bitwise conjunction operators |
|
Bitwise conjunction assignment operators |
|
Multiplication operators |
|
Addition operators |
|
Unary minus operators |
|
Bitwise disjunction operators |
|
Bitwise disjunction assignment operators |
|
Output at least some of the predefined macro settings. |
|
Match an addition operation |
|
Match a comma operation |
|
Match a multiplication operation |
|
Match an add‐assign operation |
|
Match a particular integer |
|
Match any constant into a variable |
|
Match anything into a variable |
|
Create a PatternActionRule |
|
Postprocessing that is not likely to be handled in the legacy frontend/Sage III translation. |
|
Fixup template instantiations to unmark them for output followingsemantics of gnu template options |
|
Propagate hidden list information for variables, types, and class elaboration. |
|
Rewrites a while or for loop so that the official test is changed to "true" and what had previously been the test is now an if‐break combination (with an inverted condition) at the beginning of the loop body |
|
Read a list of items of type ItemGen, they are separated using 'sep' |
|
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 |
|
Remove the declaration of a given variable |
|
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 an assignment statement with the result of a statement generator. Assumptions: from has assignment expr at top level of statement from is not in the test of a loop or if statement not currently traversing from |
|
Replace a child of a node. |
|
Replace the expression "from" with another expression "to", wherever it appears in the AST. The expression "from" is not deleted, and may be reused elsewhere in the AST. |
|
This function acts in two different ways |
|
This traversal calls ResetFileInfoParentPointersInMemoryPool Memory Pool traversal. |
|
Interface function to reset parent pointers. |
|
This traversal calles ResetParentPointersInMemoryPool Memory Pool traversal. |
|
This is a top level function not called recursively. |
|
Sets names of template classes (calls custom traversal). |
|
Rewrite a node and its children recursively using a rule. Iterate until no more changes can be made. |
|
Find the path of the ROSE install prefix. |
|
Reads a line of text from a stream. |
|
Convert a string to an unsigned long integer. |
|
affineInequalitiesPlacer * |
|
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). |
|
Propagate definitions of a variable to its uses. Assumptions: var is only assigned at the top level of body nothing var depends on is assigned within body Very simple algorithm designed to only handle simplest cases |
|
This is a top level function not called recursively. |
|
Returns the input std::string stripped of leading and trailing spaces. |
|
Unparse the declaration as a string for use in prototypes within the AST rewrite mechanism prefix mechanism |
|
Support for handling directories of files in ROSE (useful for code generation). |
|
User callable function available if compilation using the backend compiler is not required. |
|
Support for refactored handling directories of files. |
|
User callable function available if compilation using the backend compiler is not required. |
|
User callable function available if compilation using the backend compiler is not required. |
|
Unparse the header of the scope statement (used in the prefix generation to permit context to be accounted for the in generation of AST fragements from strings, e.g. for cases in SgSwitchStatement). |
|
Unparse header of statements that have bodies (but are not scopes) (e.g. SgDefaultOptionStmt) |
|
Stream insertion operators |
|
Equality operators |
|
Inequality operators |
|
Less‐than operators |
|
Less‐than‐or‐equal operators |
|
Greater‐than operators |
|
Greater‐than‐or‐equal operators |
Variables
Name |
Description |
Numeric form of ROSE version. |
|
Match anything |
|
Translation (directive lowering) support for OpenMP 3.0 C/C++ |
|
Using Declarations
Using Namespace Directives
AST_Graph namespace
Types
Name |
Description |
* The class class DataMemberPointersToIR implements two different ways of constructing a graph from the AST. * The memory pool traversal which is why the class inherits fromROSE_VisitTraversal * Whole AST traversal through traversing on nodes This design decision is peculiar out from a inheritance perspective, butmakes sence to bridge between the iheritance style of Marcus and an STLalgorithm style. Caveats: * one member functions is only used by the memory pool traversal ‐visit(..) The member function generateGraphFromMemoryPool(..) is required toachieve STL style algorithms where the bace‐class uses implemenatation byvirtual functions. Great things: * avoid duplicate implementation * allows a very simple implementation****** |
|
* The functional struct defaultFilterBinary is an example filter on edges. |
|
* The functional struct defaultFilterUnary is an example filter on nodes. |
|
* Define custom return type from the filter functionals. This is an experiment to see if a std::pair like data structure where the variables names are not std::pair<>::first and std::pair<>::second. This data structure is expectedto change as the code develops.* |
|
Enums
Functions
Name |
Description |
|
|
|
|
Two my_pairs of the same type are equal iff their members are equal. |
|
Uses |
|
<http://gcc.gnu.org/onlinedocs/libstdc++/20_util/howto.html#my_pairlt> |
|
Uses |
|
Uses |
|
Uses |
ASTtools namespace
Types
Name |
Description |
Store a list of non‐local "jumps" (continues, breaks) and ids. |
|
Stores a list of 'this' expressions. |
|
Stores a collection of SgVariableSymbols (var syms). |
Functions
Name |
Description |
Append a deep‐copy of statement s onto the basic block b. |
|
Append a deep‐copy of statements from a to the basic block b. |
|
Attaches a string as a new C++‐style comment to the given statement. |
|
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 |
|
Returns the preprocessing information list attached to the given statement; if no preprocessing information exists, then this routine will create an empty list and return its pointer. Thus, this routine is guaranteed to return a non‐NULL result. |
|
Removes all preprocessing information at a given position. |
|
Create a deep‐copy of an SgNode |
|
Dumps a statement's preprocessing information. |
|
Dump a symbol table. |
|
Search for the first surrounding function definition. |
|
Search for the first surrounding scope that may contain a function def. |
|
Returns the name of the class of a member function. |
|
Returns the unqualified name of the member function. |
|
Returns the number of function arguments, including 'this' for member functions. |
|
Returns a non‐templated, unqualified name. |
|
Inserts an '#include' of a header file at the first statement. |
|
Returns 'true' if this node is contained in a C99‐only project. |
|
Returns 'true' if the specific function is a 'const' member function. |
|
Returns 'true' if the specified type is a 'const' object. |
|
Returns true if 'func' is a constructor. |
|
Returns true if 'func' is a destructor. |
|
Returns 'true' iff the given function is declared 'extern "C"'. |
|
Returns true iff the function's unqualified name equals the target name. |
|
Returns true iff the function's unqualified name begins with the target prefix. |
|
Returns 'true' <==> 's' is the condition of some 'if' statement. |
|
Returns true if the info is an '#if', '#ifdef', or '#ifndef'. |
|
Returns true if the info is an '#elif' or '#else'. |
|
Returns 'true' if the function is 'main'. |
|
Returns true if info is positioned after its statement. |
|
Returns true if info is positioned before its statement. |
|
Returns true if info is positioned inside its statement. |
|
Returns true iff the given function declaration is 'static'. |
|
Returns 'true' if the scope is the '::std' namespace. |
|
Returns 'true' <==> 's' is the conditional selector of some 'switch' statement. |
|
|
|
Returns 'true' <==> 's' is the condition of some 'while' or 'do ... while' statement. |
|
Moves 'after' preprocessing information. |
|
Moves 'before' preprocessing information. |
|
Moves 'inside' preprocessing information. |
|
Move statements from one basic‐block to another. |
|
Moves preprocessingInfo of stmt2 to stmt1. |
|
Returns a newly allocated file info object for transformation nodes. |
|
Pastes preprocessing information at the back of a statement. |
|
Pastes preprocessing information at the front of a statement. |
|
Replaces one statement with another. |
|
Reset source position as transformation for the current node only |
|
Reset source position as transformation recursively |
|
Convert a variable symbol set to a string‐friendly form for debugging. |
|
Convert a node's location to a string‐friendly form. |
|
Create an SgBasicBlock shell around an existing SgBasicBlock. |
AstDOTGenerationExtended_Defaults namespace
AstQueryNamespace namespace
Inherited attribute for AstQuery class.
Types
Name |
Description |
* The class class AstQuery traverses the memory pool and performs the action specified in a functional on every node. The return value is a list of SgNode*.***** |
|
Simplifies development of queries on the AST that return lists of AST nodes. |
|
Enums
Name |
Functions
Name |
Description |
|
|
|
|
|
AstUtilInterface namespace
Types
Name |
Description |
Stores dependence entries in a table. |
|
Enums
Name |
Functions
Name |
Description |
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. |
|
Returns a string that uniquely identifies the given variable. If provided with a dict_table, save the file name and line number for the signature. |
|
Stream insertion operator |
CLANG_ROSE_Graph namespace
Variables
Name |
CPreproc namespace
Types
Name |
Description |
Stores a preprocessor '#if' directive and nested directives. |
|
Find the '#if' case surrounding a given node. |
|
Traversal to extract '#if' directives. |
|
Stores lists of directives. |
Functions
Name |
Description |
|
|
Extracts the '#if' directive structure from a project. |
|
Locate the '#if' directive context at a node. |
CallTargetSet namespace
Functions
Name |
Description |
Populates functionList with declarations of all functions that may get called. This is basically a wrapper around getPropertiesForExpression. |
|
Populates functionList with definitions of all functions that may get called. This is basically a wrapper around getPropertiesForExpression that extracts the SgFunctionDefinition from the Properties object. This returns only callees that have definitions ‐ to get all possible callees, use getDeclarationsForExpression |
|
Returns the list of all constructors that may get called via an initialization. |
|
Finds all functions that match the function type of pointerDerefExp |
|
Checks if the functionDeclaration (node) matches functionType |
|
CommandlineProcessing namespace
Command line processing utility functions. Functions in this namespace are in the ROSE Utilities library and
Types
Name |
Description |
RAII storage for argv‐style arguments without heap allocation. |
Functions
Name |
Description |
Add another valid source file suffix. |
|
Add the strings in argList to the command line. |
|
Release argv allocated by generateArgcArgvFromList. |
|
Convert an argc‐argv pair into a string vector. |
|
Separate a string into individual parameters. |
|
Convert a string vector back to an argc‐argv pair. |
|
Looks for inputPrefix prefixed options. |
|
Looks for inputPrefix‐prefixed options. |
|
Find all options matching the given prefix. |
|
Build the list of isolated file names from the command line. |
|
Build a string from the argList. |
|
Search 'argv' for an option like optionPrefixOption. |
|
|
|
Remove file names specified in filenameList from argv. |
|
Remove all options matching a specified prefix. |
|
Remove all options matching a specified prefix along with their values. |
Variables
ConstantFolding namespace
Types
Functions
Name |
Description |
Calculate the result of a binary operation on two constant float‐kind values, |
|
string type and binary operator: the allowed operations on string values |
|
This is the external interface of constant folding: |
|
DUVariableAnalysisExt namespace
Dbg namespace
DominatorTreesAndDominanceFrontiers namespace
Types
Name |
Description |
This class constructs a control flow graph for a given function definition. It builds off of information provided by CFGImpl.h, and adds some additional bookkeeping information (such as entry and exit points, as well as having a separate node for each statement in the graph). |
|
This class is a node in the CFG. It can either be an SgNode or it can be a special entry or exit node (since there are some empty blocks in the CFG). |
|
This class provides a uniform view of the CFG dissregarding the direction of the CFG‐traversal (forward/backward) |
|
TemplatedDominatorTree constructs a dominator/postdominator tree for a cfg. For the template parameter any cfg following Jeremias interface may be used |
|
STD‐Dominator‐Tree |
Enums
Name |
IncludeFileGraph namespace
Functions
Variables
Name |
IncludeFileSupport namespace
Functions
Name |
Inliner namespace
Variables
Name |
IntegerOps namespace
Bit‐wise operations on integers.
Types
Functions
Name |
Description |
Determines if one bitmask is a subset of another. Returns true if the bits set in the first argument form a subset of the bits set in the second argument. |
|
Counts how many bits are clear (zero). |
|
Counts how many bits are set (one). |
|
Extract bits from a value. Bits |
|
|
|
Returns true if the value is a power of two. Zero is considered a power of two. |
|
Returns the base‐2 logorithm of |
|
Optionally returns the zero‐origin position of the most significant set bit. Returns nothing if no bits are set. |
|
Rotate the bits of the value left by count bits. |
|
Rotate bits of the value right by |
|
Shifts bits of |
|
Shifts bits of |
|
Shifts bits of |
|
Create a shifted value. The return value is created by shifting |
|
Bitmask with bit |
|
Returns true if the sign bit is set, false if clear. |
|
Sign extend value. If the bit |
|
IntegerOpsPrivate namespace
MangledNameSupport namespace
Types
Name |
Functions
Variables
MaxSourceExtents namespace
Functions
NameQuery namespace
Functions
Name |
Description |
|
|
|
|
**** |
|
NewCallGraph namespace
NodeQuery namespace
Types
Functions
Name |
Description |
|
|
|
|
|
Using Namespace Directives
Name |
NumberQuery namespace
Functions
Name |
Description |
|
|
|
|
**** |
OmpSupport namespace
Types and functions to support OpenMP
Types
Name |
Description |
A driver to traverse AST trees and invoke individual translators for OpenMP constructs, (not in use) Postorder is preferred. |
|
Enums
Name |
Description |
The type of target runtime libraries (not yet in use) |
Functions
Name |
Description |
Add a variable into a non‐reduction clause of an OpenMP statement, create the clause transparently if it does not exist |
|
Attach an OpenMP clause to directive |
|
Special handling when trying to build and insert a variable declaration into a BB within Fortran OpenMP code |
|
Build a non‐reduction variable clause for a given OpenMP directive. It directly returns the clause if the clause already exists |
|
Categorize mapped variables |
|
Collect all variables from OpenMP clauses associated with an omp statement: private, reduction, etc |
|
|
|
Collect threadprivate variables within the current project, return a set to avoid duplicated elements. No input parameters are needed since it finds match from memory pools |
|
Create an initial value according to reduction operator type |
|
Analysis helpers |
|
Extract map clause information |
|
Generate GOMP loop schedule next function's name |
|
Generate GOMP loop schedule start function's name |
|
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 |
|
Return a reduction variable's reduction operation type |
|
Check if an OpenMP statement has a clause of type vt |
|
Insert #include "xxx.h", the interface of a runtime library to the compiler |
|
Insert runtime init and terminate routines to main() entry |
|
Check if an OpenMP construct is a clause |
|
Check if an OpenMP construct is a dependence type for omp task depend |
|
Check if an OpenMP construct is a directive |
|
Check if an OpenMP directive has a structured body |
|
Check if the construct is a Fortran directive which can (optionally) have a corresponding END directive |
|
Check if the construct is a Fortran END ... directive |
|
|
|
Check whether a SgNode is inside omp target |
|
Check if an OpenMP construct is a reduction operator |
|
Check if a variable access is a shared access , assuming it is already within an OpenMP region. |
|
Check if a variable is a threadprivate variable. It will search for all threadprivate directives to find the answer. |
|
The top level interface to translate OpenMP directives |
|
Patch up firstprivate variables for omp task. The reason is that the specification 3.0 defines rules for implicitly determined data‐sharing attributes and this function will make the firstprivate variable of omp task explicit. |
|
|
|
makeDataSharingExplicit() can call some of existing functions for some work in OmpSupport namespace by Hongyi 07/16/2012 TODO: add a function within the OmpSupport namespace, the function should transform the AST, so all variables' data‐sharing attributes are explicitied represented in the AST. ROSE has dedicated AST nodes for OpenMP directives and the associated clauses, such as private, shared, reduction. |
|
Remove one or more clauses of type vt |
|
|
|
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 |
|
Check if an omp for/do loop use static schedule or not, including: default schedule, or schedule(static[,chunk_size]) |
Variables
OpenAnalysis namespace
Types
Name |
Description |
BaseGraph is the abstract base class (the "interface") for a general graph. It defines graph properties common to directed and undirected graphs. It leaves out some loose ends in the interface: 1. A node has no notion of incident edges or neighboring nodes because the number of kinds of incident edges or neighboring nodes is dependent upon the graph being directed or undirected. 2. For the same reason, the method delete(node) cannot delete any incident edges. Therefore the directed or undirected graph must override it with a more complete version. Similarly, the method delete(edge) cannot delete the edge from the list(s) of the nodes involved. 3. In an analogous manner, the method add(edge) must be overridden with a more complete version that adds the edge into the records of the nodes involved, if needed. |
|
CFG is a DGraph (directed graph) with enhanced nodes and edges. Each node in the CFG points to a list of statements that together represent a basic block. The entire program would be represented by a set of CFGs, one for each subroutine, and one for the main program. |
|
DGraph is the base class for a general directed graph (DGraph) that is in turn derived from BaseGraph. Algorithms that operate upon abstract directed graphs should, normally, use only this base DGraph class for maximum portability. |
|
Exception is the abstract base class for all exceptions that can be thrown by Mint programs. |
|
The Iterator abstract base class defines the basic properties of an iterator. |
|
Enums
Name |
Functions
Using Declarations
Name |
Outliner namespace
Namespaces
Name |
Types
Name |
Description |
Stores the main results of an outlining transformation. |
Functions
Name |
Description |
Generates a function call parameter list using a set of symbols |
|
Computes the set of variables in 's' that need to be passed to the outlined routine (semantically equivalent to shared variables in OpenMP) |
|
Accept a set of command line options to adjust internal behaviors |
|
Generates a call to an outlined function. |
|
Create a unique outlined‐function's wrapper argument name for the specified statement. |
|
Create a unique outlined‐function name for the specified statement. |
|
the lib source file's name convention is rose_input_lib.[c|cxx]. |
|
Generate a new source file under the same SgProject as target, the file's base name is file_name_str. Suffix is automatically generated according to the file suffix of s |
|
Generate packing (wrapping) statements for the variables to be passed |
|
Generate a struct declaration to wrap all variables to be passed to the outlined function There are two ways to wrap a variable: Using its value vs. Using its address (pointer type) |
|
Obtain the file handle to the separated source file storing outlined functions. This file will be compiled to .so dynamically loadable library. target is the input code block for outlining. It provides SgProject and input file name info. the lib source file's name convention is rose_input_lib.[c|cxx]. |
|
Returns true iff the statement is "outlineable." |
|
|
|
Outlines all regions marked by outlining pragmas. |
|
Outlines the given basic block into a function named 'name'. |
|
Validate and adjust analysis settings. |
Variables
Name |
Description |
A set of flags to control the internal behavior of the outliner |
|
Outliner::Preprocess namespace
Functions
Name |
Description |
Sanity check and patch up outliner options |
|
Convert the "plain‐old" statement into an SgBasicBlock. This normalization simplifies outlining of single statements. |
|
Gathers non‐local declarations into the local scope. |
|
Normalizes outline targets that are variable declarations, returning a new SgBasicBlock to outline. |
|
Preprocesses the outline target and returns an equivalent SgBasicBlock to outline. |
|
Constant propagation for static member variables |
|
Preprocess non‐local control flow for outlining. |
|
Transform '#if' directive structure. It is possible that certain preprocessor directives may straddle the boundaries of a basic block. This routine attempts to detect and transform these instances so that the block may be safely outlined. |
|
Canonicalize references to 'this'. |
POET namespace
Types
Name |
ProcessExpression namespace
Functions
Name |
Description |
Helper Function to process Left Hand Side of an Expression |
|
Helper Function to process Right Hand Side of an Expression |
ROSE_Analysis namespace
Functions
Name |
ROSE_Statistics namespace
This is a mechanism for reporting statistical data about the AST, subtrees, and IR nodes.
ROSE_token_ids namespace
Rose namespace
Namespaces
Name |
Description |
Bit operations on unsigned integers. |
|
Functions for operating on files in a filesystem. |
|
Functions for operating on strings. |
|
Types
Name |
Description |
A nested logging mechanism to facilitate debbuging of tree traversal. |
|
A global registry used in conjunction with static constructors to make pluggable components (like targets or garbage collectors) "just work" when linked with an executable. |
|
Traits for registry entries. If using other than SimpleRegistryEntry, it is necessary to define an alternate traits class. |
|
A simple registry entry which provides only a name, description, and no‐argument constructor. |
|
A range adaptor for a pair of iterators. |
|
Functions
Name |
Description |
get the sourceDirectory directory |
|
get the filename from the full filename |
|
Functions to move to SgStatement object in SAGE III later |
|
get the current directory |
|
Convenience function for iterating over sub‐ranges. |
|
Variables
Name |
Description |
Invalid array index. |
|
Effectively unlimited size. |
|
Rose::BitOps namespace
Bit operations on unsigned integers.
Functions
Name |
Description |
Generate a value with all bits set or cleared. |
|
Set or clear the low‐order bits. |
|
Extract a single bit. |
|
Extract a single bit. |
|
Extract part of a value. |
|
Extract part of a value limited by width. |
|
Extend or truncate a value. |
|
Sign extend or truncate a value. |
|
Generate a value with high order bits set. |
|
Generate a value with low order bits set. |
|
Generate a mask. |
|
Generate a mask without affecting other bits. |
|
Most significant bit. |
|
Most significant bit within lsb region. |
|
Number of bits in a type or value. |
|
Generate a single‐bit mask. |
|
Generate a single‐bit mask without affecting the high‐order bits. |
|
Replicate low‐order bits to fill return value. |
|
Replicate low‐order bits to fill region without affecting other bits. |
|
Rotate bits left. |
|
Rotate low‐order bits left without affecting others. |
|
Rotate bits right. |
|
Rotate low‐order bits right without affecting others. |
|
Combine two values based on a bit mask. |
|
Left shift a value. |
|
Left shift part of a value without affecting the rest. |
|
Right shift a value. |
|
Right shift part of a value without affecting the rest. |
|
|
|
Sign extend part of a value to the full width of the src type. |
|
Sign extend part of value without affecting other bits. |
Rose::Builder namespace
Namespaces
Name |
Rose::Builder::Templates namespace
Rose::Cmdline namespace
Enums
Name |
Description |
Constants to be used with CommandlineProcessing::isOptionWithParameter to specify the removeOption argument. |
Functions
Name |
Description |
Convert |
|
Removes "‐rose:" options, or transforms them into their associated compiler options. |
|
Variables
Name |
Rose::Cmdline::Fortran namespace
Namespaces
Name |
Description |
Targeted for src/frontend/OpenFortranParser_SAGE_Connection/jserver.C, |
Functions
Name |
Description |
Process all Fortran commandline options. |
|
Rose::Cmdline::Fortran::Ofp namespace
Targeted for src/frontend/OpenFortranParser_SAGE_Connection/jserver.C,
Functions
Name |
Description |
‐rose:fortran:ofp:classpath |
|
‐rose:fortran:ofp:enable_remote_debugging Enable remote debugging of the OFP JVM. |
|
‐rose:fortran:ofp:jvm_options |
|
Variables
Rose::Cmdline::Gnu namespace
Functions
Rose::Cmdline::Unparser namespace
Functions
Name |
Description |
Process all Unparser‐specific commandline options, i.e. ‐rose:unparser. |
|
Rose::FileSystem namespace
Functions for operating on files in a filesystem.
Types
Name |
Description |
Predicate returning true for matching names. |
|
Iterate over directory contents non‐recursively. |
|
Name of entities in a filesystem. |
|
Iterate recursively into subdirectories. |
Functions
Name |
Description |
Copy a file. |
|
Copy files from one directory to another. |
|
Recursively copy files. |
|
Create a temporary directory. |
|
Entries within a directory. |
|
Recursive list of names satisfying predicate. |
|
Return a list of all rose_* files |
|
Predicate returning true for existing directories. |
|
Predicate returning true if path exists. |
|
Predicate returning true for existing regular files. |
|
Predicate returning inverse of |
|
Predicate returning true for existing symbolic links. |
|
Make path absolute. |
|
Normalize a path name. |
|
Make path relative. |
|
Load an entire file into an STL container. |
|
Convert a path to a string. |
|
Variables
Name |
Description |
Pattern to use when creating temporary files. |
Rose::Frontend namespace
Rose::KeepGoing namespace
Types
Functions
Name |
Description |
Append msg to a file |
|
Processing command line options |
|
Generates the file reports |
|
Set the project and all its files's midend error codes |
|
Rose::KeepGoing::Backend namespace
Functions
Name |
Rose::KeepGoing::Backend::Compiler namespace
Functions
Name |
Variables
Name |
Rose::KeepGoing::Backend::Unparser namespace
Functions
Name |
Variables
Name |
Rose::KeepGoing::Frontend namespace
Rose::KeepGoing::Frontend::Commandline namespace
Functions
Name |
Variables
Name |
Rose::KeepGoing::Frontend::SecondaryPass namespace
Functions
Name |
Variables
Name |
Rose::KeepGoing::Midend namespace
Functions
Name |
Variables
Name |
Rose::MemPool namespace
Functions
Name |
Rose::StringUtility namespace
Functions for operating on strings.
Types
Name |
Description |
String with source location information. |
|
A vector of strings with line numbers and file names. |
Enums
Name |
Description |
Find file names non‐recursively. |
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
Functions
Name |
Description |
Convert an interval of virtual addresses to a string. |
|
Convert a virtual address to a string. |
|
Escapes characters that are special to the Bourne shell. |
|
Escapes characters that are special to C/C++. |
|
Unescapes C++ string literals. |
|
Center a string in a field. |
|
Determine whether a file is source code or system library. |
|
Convert to lower case. |
|
Replace all occurrences of a string with another string. |
|
Escapes characters that are special in CSV tables. |
|
Convert base‐64 to binary. |
|
Edit distance between two directory names. |
|
Convert binary data to base‐64. |
|
Escapes line feeds and double quotes. |
|
Get the file name suffix (extension) without the leading dot. |
|
Normalizes line termination. |
|
Compute a checkshum. |
|
Get the absolute path from the relative path. |
|
Obtain operating system type information. |
|
Returns all but the last component of a path in a filesystem. |
|
Convert an ASCII hexadecimal character to an integer. |
|
Name of the home directory. |
|
Escapes HTML special characters. |
|
Convert an integer to a hexadecimal string. |
|
Determines whether one string contains another. |
|
Returns true if the string ends with line termination. |
|
Join strings as if they were English prose. |
|
Join individual items to form a single string. |
|
Escapes characters that are special inside a JSON string. |
|
Left justify a string to specified width. |
|
|
|
Converts a multi‐line string to a single line. |
|
|
|
Concatenate vectors of strings with source location. |
|
Append strings with source location information to vector of such. |
|
Simple wrapper for Unix popen command. |
|
Insert a prefix string before every line. |
|
Reads entire text file. |
|
Reads an entire text file. |
|
Reads words from a file. |
|
Remove ANSI escape characters. |
|
Remove redundant and blank lines. |
|
Replace a pattern with another one in a string |
|
Right justify a string to specified width. |
|
Splits strings into parts. |
|
Splits string into substring based on a separator character. |
|
Split a string into substrings at line feeds. |
|
Remove leading dots. |
|
Get the file name without the ".suffix". |
|
Returns the last component of a path in a filesystem. |
|
Convert a number to a binary string. |
|
Convert a number to a hexadecimal and decimal string. |
|
Generate C preprocessor #line directives. |
|
Split a string into a list based on a separator character. |
|
Trims white space from the beginning and end of a string. |
|
Expand horizontal tab characters. |
|
Create a file. |
|
Stream insertion operators |
Rose::Unique namespace
Functions
Name |
SageBuilder namespace
High level SAGE III AST node and subtree builders.
Enums
Functions
Name |
Description |
DQ (7/27/2012): changed semantics from removing the template arguments in names to adding the template arguments to names. |
|
Build an Actual Argument Expression |
|
Build an aggregate initializer |
|
|
|
|
|
Build a NULL statement |
|
Build the rhs of a variable declaration which includes an assignment |
|
Build an assignment statement from lefthand operand and right hand operand |
|
This version does not recursively reset the file info as a transformation. |
|
Build Fortran attribute specification statement |
|
Build a bfloat16 |
|
DQ (5/6/2013): Added build functions to support SgBaseClass construction. |
|
Build a SgBasicBlock, setting file info internally |
|
Build a SgBasicBlock and set its parent. This function does NOT link the parent scope to the block. |
|
Template function to build a binary expression of type T, taking care of parent pointers, file info, lvalue, etc. Available instances include: buildAddOp(), buildAndAssignOp(), buildAndOp(), buildArrowExp(),buildArrowStarOp(),buildAtOp, buildAssignOp(),buildBitAndOp(),buildBitOrOp(),buildBitXorOp(),buildCommaOpExp(), buildConcatenationOp(),buildDivAssignOp(),buildDivideOp(),buildDotExp(),buildEqualityOp(),buildExponentiationOp(),buildGreaterOrEqualOp(),buildGreaterThanOp(),buildIntegerDivideOp(),buildIorAssignOp(),buildLessOrEqualOp(),buildLessThanOp(),buildLshiftAssignOp(),buildLshiftOp(),buildMinusAssignOp(),buildModAssignOp(),buildModOp(),buildMultAssignOp(),buildMultiplyOp(),buildNotEqualOp(),buildOrOp(),buildPlusAssignOp(),buildPntrArrRefExp(),buildRshiftAssignOp(),buildRshiftOp(),buildReplicationOp,buildScopeOp(),buildSubtractOp()buildXorAssignOp() The instantiated functions' prototypes are not shown since they are expanded using macros. Documentation tools do not expand these macros. |
|
Template function to build a binary expression of type T, taking care of parent pointers, but without file‐info. Available instances include: buildAddOp(), buildAndAssignOp(), buildAndOp(), buildArrowExp(),buildArrowStarOp(),buildAtOp, buildAssignOp(),buildBitAndOp(),buildBitOrOp(),buildBitXorOp(),buildCommaOpExp(), buildConcatenationOp(),buildDivAssignOp(),buildDivideOp(),buildDotExp(),buildEqualityOp(),buildExponentiationOp(),buildGreaterOrEqualOp(),buildGreaterThanOp(),buildIntegerDivideOp(),buildIorAssignOp(),buildLessOrEqualOp(),buildLessThanOp(),buildLshiftAssignOp(),buildLshiftOp(),buildMinusAssignOp(),buildModAssignOp(),buildModOp(),buildMultAssignOp(),buildMultiplyOp(),buildNotEqualOp(),buildOrOp(),buildPlusAssignOp(),buildPntrArrRefExp(),buildRshiftAssignOp(),buildRshiftOp(),buildReplicationOp(),buildScopeOp(),buildSubtractOp()buildXorAssignOp() The instantiated functions' prototypes are not shown since they are expanded using macros. Documentation tools do not expand these macros. |
|
|
|
Build a bool value expression, the name convention of SgBoolValExp is little different from others for some unknown reason |
|
Build an braced initializer |
|
Build a break statement |
|
Build a case option statement |
|
Build a type casting expression |
|
Build a catch statement. |
|
Build an initial sequence of Catch blocks containing 0 or 1 element. |
|
DQ (11/7/2009): Added function to build C++ class (builds both the non‐defining and defining declarations; in that order). |
|
Build a generic class declaration statement (SgClassDeclaration or subclass) with a class declaration and definition (creating both the defining and nondefining declarations as required. |
|
Build class pointer |
|
Some support for building class template instantiation declarations. Note, the template is not actually instantiated, but a `forward declaration' node is created. |
|
Build a Fortran colon‐shape expression, set file info as the default one. |
|
No file info version of buildColonShapeExp(). File info is to be set later on. |
|
Build and attach a comment, comment style is inferred from the language type of the target node if not provided. It is indeed a wrapper of SageInterface::attachComment(). |
|
Build a Fortran Common statement |
|
Build a Fortran common block, possibly with a name |
|
Build a complex type |
|
Build a compound initializer, for vector type initialization |
|
Build function for compound literals (uses a SgVariableSymbol and is similar to buildVarRefExp_nfi()). |
|
Build a conditional expression ?: |
|
Build a const type. |
|
Build a const/volatile type qualifier |
|
Build a const volatile type. |
|
Build a continue statement |
|
Build and attach #define XX directives, pass "#define xxx xxx" as content. |
|
Build a CUDA kernel call expression (kernel<[config]>(parameters)) |
|
Build a CUDA kernel execution configuration (<blocks, shared, stream>) |
|
Build a variable reference expression without symbol‐table lookup. |
|
Build a decltype reference type |
|
Build a scope statement. Used to build SgNonrealDecl and SgNonrealType |
|
Build a default option statement |
|
Build a function declaration with a function body |
|
Build a defining ( non‐prototype) member function declaration |
|
Build a delete statement |
|
Build an SgDerivedTypeStatement Fortran derived type declaration with a class declaration and definition (creating both the defining and nondefining declarations as required). |
|
Build do‐while statement |
|
Build a double value expression |
|
Build an empty declaration (useful for adding precission to comments and CPP handling under token‐based unparsing). |
|
Build an enum, It is also a declaration statement in SAGE III |
|
Build an enum, It is also a declaration statement in SAGE III |
|
Build a SgExprListExp, used for function call parameter list etc. |
|
Build a SgExprStatement, set File_Info automatically |
|
AST high level builders for others |
|
Build a float16 |
|
Build a float32 |
|
Build a float64 |
|
Build a float value expression by converting the string |
|
Build a for init statement |
|
Build a for statement, assume none of the arguments is NULL |
|
Build a Fortran continue statement |
|
Build a Fortran do construct |
|
Build a type based on Fortran's implicit typing rules. Currently this interface does not take into account possible implicit statements that change the rules. |
|
Build Fortran include line |
|
Build a type based on the Fortran kind mechanism |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Build a goto statement from a label expression, supporting only C/C++ and not Fortran cases |
|
Build a dangling #include "x.h" header, insertHeader() is needed to actually insert it |
|
Build if statement |
|
Build an imaginary type |
|
e.g the scope of arguments of functions are different for defining and nondefining functions. |
|
Build an integer value expression |
|
Build an integer value expression by converting the string |
|
Build a Fortran numeric label ref exp |
|
Note that the scope of a label statement is special. It is SgFunctionDefinition, not the closest scope statement such as SgBasicBlock. |
|
DQ (9/3/2014): Adding support for C++11 Lambda expressions |
|
Build a long integer value expression |
|
Build a long long integer value expression |
|
|
|
DQ (8/19/2012): Refactored some of the code supporting construction of the SgMemberFunctionType. |
|
DQ (8/17/2014): Adding support for MS‐style attribute declarations. |
|
Build ‐‐ expression, Sgop_mode is a value of either SgUnaryOp::prefix or SgUnaryOp::postfix |
|
Build a modifier type. |
|
Build a Fortran module declaration. |
|
DQ (4/30/2010): Added support for building nop statement using asm statement Building nop statement using asm statement |
|
tps (09/02/2009) : Added support for building namespaces |
|
Build noexcept operator expression with an expression parameter |
|
DQ (11/7/2009): Added functions to build C++ class. |
|
Build an enum first nondefining declaration, without file info |
|
|
|
Build a prototype member function declaration |
|
Build a nondefining SgProcedureHeaderStatement, handle function type, symbol etc transparently |
|
buildNondefiningTemplateClassDeclaration() |
|
DQ (11/29/2011): Adding template declaration support to the AST. |
|
Build a declaration of a non‐real class or class‐member representing template parameters and their members |
|
Build a reference to the non‐real declaration of a member of a non‐real class |
|
|
|
Build a null expression, set file info as the default one. |
|
No file info version of buildNullExpression(). File info is to be set later on. |
|
Build a NULL statement |
|
DQ (7/31/2014): Adding support for C++11 nullptr const value expressions. |
|
Build an opaque type with a name, useful when a type's details are unknown during transformation, especially for a runtime library's internal type. Must provide scope here. Some types are not known during translation but nevertheless are needed. For example, some internal types from a runtime library. To work around this problem: this function prepends a hidden typedef declaration into scope 'typedef int OpaqueTypeName;' The translation‐generated code is expected to include the runtime library's headers to have the real type declarations. |
|
Build a variable reference expression at scope to an opaque variable which has unknown information except for its name. Used when referring to an internal variable defined in some headers of runtime libraries.(The headers are not yet inserted into the file during translation). Similar to buildOpaqueType(); It will declare a hidden int varName at the specified scope to cheat the AST consistence tests. |
|
Build ++x or x++ , specify prefix or postfix using either SgUnaryOp::prefix or SgUnaryOp::postfix |
|
Pei‐Hung (06/30/2023): support for SgPointerMemberType |
|
Build a pointer type |
|
Build SgPragma |
|
Build pragma declaration, handle SgPragma and defining/nondefining pointers internally |
|
Build a Fortran subroutine or procedure |
|
Build a reference type |
|
Build a restrict type. |
|
Build a return statement |
|
Build a rvalue reference type |
|
Build a signed char |
|
|
|
|
|
Build a GNU statement expression |
|
DQ (7/25/2014): Adding support for C11 static assertions. |
|
Build a StmtDeclarationStmt |
|
DQ (8/21/2010): We want to move to the new buildStringType( SgExpression*,size_t) function over the older buildStringType() function. |
|
Build a structure, It is also a declaration statement in SAGE III |
|
Build a SgSubscriptExpression, used for array shape expressions. The lower bound and stride may be nullptrs |
|
Build super pointer |
|
Build a switch statement |
|
Build tempplate class declaration |
|
Build a template class definition statement |
|
Same as buildClassTemplateType(), just better name |
|
DQ (12/15/2011): Adding template declaration support to the AST. |
|
DQ (12/29/2011): Adding template declaration support to the AST. |
|
Build a template parameter, passing enum kind and SgTemplateType template_parameter_enum { parameter_undefined = 0, type_parameter = 1, nontype_parameter = 2, template_parameter = 3} |
|
Build an template parameter value expression |
|
Build a template type, used for template parameter and later argument |
|
Build template variable declarations |
|
Build this pointer |
|
Build a ThrowOp expression |
|
Build a try statement. |
|
DQ (7/24/2014): Adding support for c11 generic operands. |
|
DQ (1/25/2013): Added support for typeId operators. |
|
Build a GNU typeof operator |
|
Build a typedef declaration, such as: typedef int myint; typedef struct A {..} s_A; |
|
Template function to build a unary expression of type T. Instantiated functions include:buildAddressOfOp(),buildBitComplementOp(),buildBitComplementOp(),buildMinusOp(),buildNotOp(),buildPointerDerefExp(),buildUnaryAddOp(),buildMinusMinusOp(),buildPlusPlusOp(). They are also used for the unary vararg operators (which are not technically unary operators). The instantiated functions' prototypes are not shown since they are expanded using macros. Documentation tools do not expand these macros. |
|
Template function to build a unary expression of type T with no file info. Instantiated functions include:buildAddressOfOp(),buildBitComplementOp(),buildBitComplementOp(),buildMinusOp(),buildNotOp(),buildPointerDerefExp(),buildUnaryAddOp(),buildMinusMinusOp(),buildPlusPlusOp(). They are also used for the unary vararg operators (which are not technically unary operators). The instantiated functions' prototypes are not shown since they are expanded using macros. Documentation tools do not expand these macros. |
|
Build an unsigned char |
|
Build an unsigned integer |
|
Build an unsigned long long integer |
|
Build a unsigned long integer |
|
Build an unsigned short integer |
|
Build a using directive statement |
|
Build vararg op expression |
|
|
|
Build a variable declaration, handle symbol table transparently |
|
Build variable definition |
|
handle side effects of parent pointers, Sg_File_Info, lvalue etc. |
|
DQ (2/14/2019): Adding support for C++14 void value expressions. |
|
Build a volatile type. |
|
Build while statement |
|
display function for debugging |
|
Error checking the inserted snippet AST. |
|
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. |
|
Support to retrive the SgGlobal from the internal scope stack (error if not present in a non‐empty list, return null for empty list). |
|
Get the current source position classification (defines how IR nodes built by the SageBuilder interface will be classified). |
|
Public interfaces of the scope stack, should be stable |
|
Set the current source position classification (defines how IR nodes built by the SageBuilder interface will be classified). |
|
DQ (9/16/2012): Added function to support setting the template arguments and setting their parents (and for any relevant declaration). |
|
DQ (2/11/2012): Added support to set the template name in function template instantiations (member and non‐member). |
|
DQ (9/16/2012): Added function to support setting the template parameters and setting their parents (and for any relevant declaration). |
|
DQ (3/9/2018): Added to support debugging. |
Variables
Name |
Description |
intended to be a private member, don't access it directly. could be changed any time |
|
C++ SageBuilder namespace specific state for storage of the source code position state (used to control how the source code positon is defined for IR nodes built within the SageBuilder interface). |
|
Support for construction of case sensitive/insensitive symbol table handling in scopes. |
Using Namespace Directives
Name |
SageInterface namespace
Functions that are useful when operating on the AST.
Types
Name |
Description |
Add, remove,and replace AST |
|
Interface for creating a statement whose computation writes its answer into a given variable. |
|
A persistent attribute to represent a unique name for an expression |
|
The datastructure is used as the return type for SageInterface::evaluateConstIntegerExpression(). One needs to always check whether hasValue_ is true before accessing value_ |
Enums
Name |
Description |
Function to delete AST subtree's nodes only, users must take care of any dangling pointers, symbols or types that result. |
Functions
Name |
Description |
strip off typedef and modifer types, then check if a type is a class type, excluding union type. |
|
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. |
|
Function to add "C" style comment to statement. |
|
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 |
|
Add a string to be unparsed to support code generation for back‐end specific tools or compilers. |
|
Find all SgPntrArrRefExp under astNode, then add SgVarRefExp (if any) of SgPntrArrRefExp's dim_info into NodeList_t |
|
Generate unique names for expressions and attach the names as persistent attributes ("UniqueNameAttribute") |
|
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. |
|
Append an expression to a SgExprListExp, set the parent pointer also |
|
Append an expression list to a SgExprListExp, set the parent pointers also |
|
|
|
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. |
|
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. |
|
Attach an arbitrary string to a located node. A workaround to insert irregular statements or vendor‐specific attributes. |
|
|
|
Generate a non‐defining (forward) declaration from a defining function declaration. |
|
Call liveness analysis on an entire project |
|
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 |
|
Remove unused basic block IR nodes added as part of normalization. |
|
Clears the cache of scope,integer pairs for the input function. |
|
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. |
|
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 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. |
|
Check if a type (or any nested type) is unknown/incomplete. |
|
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. |
|
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 an expression |
|
Deep copy a statement |
|
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. |
|
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. |
|
Generate a unique string from the source file position information |
|
Check if a defining declaration comes before of after the non‐defining declaration. |
|
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); |
|
Deep copy an arbitrary subtree |
|
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() |
|
Special purpose function for deleting AST expression tress containing valid original expression trees in constant folded expressions (for internal use only). |
|
Normalize a Fortran Do loop. Make the default increment expression (1) explicit |
|
Dump information about a SgNode for debugging |
|
Dumps a located node's preprocessing information. |
|
Find the enclosing namespace of a declaration |
|
Check if the body of a 'case option' statement is a SgBasicBlock, create one if not. |
|
Check if the body of a 'catch' statement is a SgBasicBlock, create one if not. |
|
Check if the body of a 'default option' statement is a SgBasicBlock, create one if not. |
|
Check if the body of a 'do .. while' statement is a SgBasicBlock, create one if not. |
|
Check if the body of a 'for' statement is a SgBasicBlock, create one if not. |
|
Check if the body of a SgOmpBodyStatement is a SgBasicBlock, create one if not |
|
Check if the body of a 'switch' statement is a SgBasicBlock, create one if not. |
|
Check if the body of a 'while' statement is a SgBasicBlock, create one if not. |
|
Check if the false body of a 'if' statement is a SgBasicBlock, create one if not when the flag is true. |
|
Check if the true body of a 'if' statement is a SgBasicBlock, create one if not. |
|
The function tries to evaluate const integer expressions (such as are used in array dimension sizes). It follows variable symbols, and requires constness. |
|
Extract a SgPragmaDeclaration's leading keyword . For example "#pragma omp parallel" has a keyword of "omp". |
|
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) |
|
Find the first defining function declaration statement in a scope |
|
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>. |
|
Find the function type matching a function signature plus a given return type |
|
Find the preprocessingInfo node representing #include <header.h> or #include "header.h" within a source file. Return NULL if not found. |
|
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. |
|
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 |
|
Fix symbols, parent and scope pointers. Used internally within appendStatment(), insertStatement() etc when a class declaration was built without knowing its target scope. |
|
Fix the symbol table and set scope (only if scope in declaration is not already set). |
|
Fix symbol table for SgLabelStatement. Used Internally when the label is built without knowing its target scope. Both parameters cannot be NULL. |
|
Fix symbols, parent and scope pointers. Used internally within appendStatment(), insertStatement() etc when a namespace declaration was built without knowing its target scope. |
|
A wrapper containing fixes (fixVariableDeclaration(),fixStructDeclaration(), fixLabelStatement(), etc) for all kinds statements. Should be used before attaching the statement into AST. |
|
Fix symbols, parent and scope pointers. Used internally within appendStatment(), insertStatement() etc when a struct declaration was built without knowing its target scope. |
|
Fix the symbol table and set scope (only if scope in declaration is not already set). |
|
Patch up symbol, scope, and parent information when a SgVariableDeclaration's scope is known. |
|
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. |
|
All the symbol table references in the copied AST need to be reset after rebuilding the copied scope's symbol table. |
|
Normalize a for loop, return true if successful. Generated constants will be fold by default. |
|
Get the mask expression from the header of a SgForAllStatement |
|
|
|
Returns STL vector of SgFile IR node pointers. |
|
Added mechanism to generate project name from list of file names |
|
Generate unique name from C and C++ constructs. The name may contain space. |
|
Generate a useful name to support construction of identifiers from declarations. |
|
Generate a name like temp# that is unique in the current scope and any parent and children scopes. # is a unique integer counter. |
|
Obtain all the queryed statement at line of a source file |
|
Calculate the number of elements of an array type: dim1* dim2*... , assume element count is 1 for int a[]. |
|
Get the element type of an array. It recursively find the base type for multi‐dimension array types |
|
Get the enclosing type of this associated node, not used other than in ./src/backend/unparser/nameQualificationSupport.C |
|
Get the type of the associated argument expression from the function type. |
|
Get the right bool type according to C or C++ language input |
|
Given a SgExpression that represents a named function (or bound member function), return the mentioned function |
|
Returns the type introduced by a declaration. |
|
Get the default constructor from the class declaration |
|
Get the default destructor from the class 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 number of dimensions of an array type |
|
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. |
|
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 |
|
return the first global scope under current project |
|
Get the first initialized name of a declaration statement |
|
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. |
|
Obtain the first queryed statement at line of a source file |
|
Get the variable symbol for the first initialized name of a declaration stmt. |
|
Get the data type of the first initialized name of a declaration statement |
|
convenience function that returns the first initialized name in a list of variable declarations. |
|
Traverse back through a node's parents to find the enclosing global scope |
|
Get a vector of input parameters from the function parameter list |
|
Get the initializer containing an expression if it is within an initializer. |
|
Get the constant value from a constant integer expression; abort on everything else. Note that signed long longs are converted to unsigned. |
|
get the last statement within a scope, return NULL if it does not exit |
|
get liveIn and liveOut variables for a for loop from liveness analysis result liv. |
|
Routines to get and set the body of a loop |
|
Routines to get the condition of a loop. It recognize While‐loop, For‐loop, and Do‐While‐loop |
|
Return the loop index variable for a for loop |
|
Get next statement within the same scope of current statement |
|
Get a vector of output parameters from the function parameter list |
|
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 current SgProject IR Node. |
|
Get the closest scope from astNode. Return astNode if it is already a scope. |
|
Query memory pools to grab SgNode of a specified type |
|
Find referenced symbols within an expression |
|
Get the enclosing TemplateDeclaration statement |
|
Get the string representing the type name |
|
returns the array dimensions in an array as defined for arrtype |
|
|
|
Add preproccessor guard around a given node. It surrounds the node with "#if guard" and "#endif" |
|
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;...) |
|
This is supporting the recognition of functions in header files from two different ASTs |
|
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. |
|
Does a type have a trivial (built‐in) destructor? |
|
Support function used for variable declarations in conditionals |
|
Support function used for variable declarations in conditionals |
|
Support function used for variable declarations in conditionals |
|
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. |
|
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. |
|
|
|
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 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 |
|
Insert statements before the first non‐declaration statement in a scope. If the scope has no non‐declaration statements |
|
Check if a node is from a header file |
|
Check if a node is from a system header file |
|
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. |
|
check if node1 is a strict ancestor of node 2. (a node is not considered its own ancestor) |
|
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. |
|
Is a type assignable? This may not quite work properly. |
|
Check if a SgNode _s is an assignment statement (any of =,+=,‐=,&=,/=, ˆ=, etc) |
|
Returns true if AST teardown is enabled for this process. |
|
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 Fortran Do loop has a complete canonical form: Do I=1, 10, 1 |
|
Check if a for‐loop has a canonical form, return loop index, bounds, step, and body if requested |
|
Check if a bool or int constant expression evaluates to be a false value |
|
Check if a bool or int constant expression evaluates to be a true value |
|
Is a type copy constructible? This may not quite work properly. |
|
Is a type default constructible? This may not quite work properly. |
|
Compare AST nodes, subtree, etc |
|
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. |
|
Test for equivalence of types independent of access permissions (private or protected modes for members of classes). |
|
Check if a declaration has an "extern" modifier |
|
Is an overloaded operator an index operator (also referred to as call or subscript operators). (e.g. X & operator()() or X & operator[]). |
|
check if a variable reference is this‐>a[i]inside of a lambda function |
|
Check if a function declaration is a C++11 lambda function |
|
Check if a statement is the last statement within its closed scope |
|
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. |
|
Check if a SgNode is a main() function declaration |
|
True if an SgInitializedName is "mutable' (has storage modifier set) |
|
Is this type a non‐constant reference type? (Handles typedefs correctly) |
|
Check if a node is SgOmp*Statement |
|
Return true if function is overloaded. |
|
|
|
Return true if expr is part of an overloaded operator‐> call chain. |
|
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) |
|
Is this type a pointer type? (Handles typedefs correctly) |
|
Is an overloaded operator a postfix operator. (e.g. ). |
|
Check for proper names of possible prefix operators (used in isPrefixOperator()). |
|
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. |
|
Is this type a const or non‐const reference type? (Handles typedefs correctly) |
|
Is this a restrict type? |
|
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. |
|
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 |
|
Check if a declaration has a "static' modifier |
|
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 |
|
Check if a SgNode is a declaration for a structure |
|
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. |
|
|
This function detects template instantiations that are relevant when filters are used. |
Check if a SgNode is a declaration for a union |
|
Check if a variable reference is used by its address: including &a expression and foo(a) when type2 foo(Type& parameter) in C++ |
|
Is this a volatile type? |
|
Used to support token unparsing (when the output the trailing token sequence). |
|
return path prefix for subtree of include files. |
|
|
|
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. |
|
utility functions for symbol tables |
|
Interchange/permutate a n‐level perfectly‐nested loop rooted at 'loop' using a lexicographical order number within (0,depth!). |
|
Tile the n‐level (starting from 1) loop of a perfectly nested loop nest using tiling size s |
|
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. |
|
Make a single statement body to be a basic block. Its parent is if, while, catch, etc. |
|
Generated mangled modifier types, include const, volatile,according to Itanium C++ ABI. |
|
Generate mangled scalar type names according to Itanium C++ ABI, the input type should pass isScalarType() in ROSE |
|
Generate a mangled string for a given type based on Itanium C++ ABI |
|
Merge an assignment into its upstream declaration statement. Callers should make sure the merge is semantically correct. |
|
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. |
|
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. |
|
Relocate comments and CPP directives from one statement to another. |
|
Relocate the declaration to be explicitly represented in its associated namespace (required for some backend compilers to process template instantiations). |
|
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. |
|
|
|
Move file to be generated in a subdirectory (will be generated by the unparser). |
|
Identical to movePreprocessingInfo(), except for the stale name and confusing order of parameters. It will be deprecated soon. |
|
Move a variable declaration to a new scope, handle symbol, special scopes like For loop, etc. |
|
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. |
|
Normalize the structure of |
|
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 |
|
Normalize a for loop's test expression i<x is normalized to i<= (x‐1) and i>x is normalized to i>= (x+1) |
|
Output function type symbols in global function type symbol table. |
|
Output the local symbol tables. |
|
Paste preprocessing information from a buffer to a destination node. Used in combination of cutPreprocessingInfo() |
|
Prepend an argument to SgFunctionParameterList |
|
|
|
prepend a list of statements to the beginning of the current scope, handling side effects as appropriate |
|
|
|
|
|
Query a subtree to get all nodes of a given type, with an appropriate downcast. |
|
Regenerate the symbol table. |
|
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. |
|
Register an AST teardown handler to run at process exit if cleanup was not invoked. |
|
Record a project for teardown when running exit handlers. |
|
Set original expression trees to NULL for SgValueExp or SgCastExp expressions, so you can change the value and have it unparsed correctly. |
|
Remove consecutive labels |
|
Remove const (if present) from a type. stripType() cannot do this because it removes all modifiers. |
|
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. |
|
Replace an expression with another, used for variable reference substitution and others. the old expression can be deleted (default case) or kept. |
|
Replace a given expression with a list of statements produced by a generator |
|
Replace a statement with another. Move preprocessing information from oldStmt to newStmt if requested. |
|
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 |
|
Replace all variable references to an old symbol in a scope to being references to a new symbol. |
|
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. |
|
Use the set of IR nodes and set the isModified flag in each IR node to true. |
|
Assigns unique numbers to each SgScopeStatement of a function. |
|
Reset map variables used to support generateUniqueNameForUseAsIdentifier() function. |
|
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. |
|
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. |
|
we have two serialize() functions, one for a single node, the other for a list of pointers |
|
a better version for SgVariableDeclaration::set_baseTypeDefininingDeclaration(), handling all side effects automatically Used to have a struct declaration embedded into a variable declaration |
|
Set a declaration as extern |
|
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. |
|
set left hand operand for binary expressions, transparently downcasting target expressions when necessary |
|
Set the condition statement of a loop, including While‐loop, For‐loop, and Do‐While‐loop. |
|
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 |
|
Set operands for expressions with single operand, such as unary expressions. handle file info, lvalue, pointer downcasting, parent pointer etc. |
|
Set parameter list for a function declaration, considering existing parameter list etc. |
|
Set a pragma of a pragma declaration. handle memory release for preexisting pragma, and set parent pointer. |
|
set left hand operand for binary expression |
|
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 |
|
set_name of symbol in symbol table. |
|
Reorder a list of declaration statements based on their appearance order in source files |
|
Replace an expression with a temporary variable and an assignment statement |
|
Split long expressions into blocks of statements |
|
|
|
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. |
|
Suggest next usable (non‐conflicting) numeric label value for a Fortran function definition scope |
|
Explicitly tear down an AST and release global caches and memory pools. AST pointers are invalid after this call. |
|
Verify that 2 SgTemplateArgument are equivalent (same type, same expression, or same template declaration) |
|
Verify that 2 SgTemplateArgumentPtrList are equivalent. |
|
Return true if template definition is in the class, false if outside of class. |
|
Undo the normalization of for loop's C99 init declaration. Previous record of normalization is used to ease the reverse transformation. |
|
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. |
|
Diagnostic function for tracing back through the parent list to understand at runtime where in the AST a failure happened. |
|
|
Variables
Name |
Description |
An internal counter for generating unique SgName |
|
Global map of name collisions to support generateUniqueNameForUseAsIdentifier() function. |
|
SgNodeHelper namespace
Namespaces
Name |
Description |
Provides functions which match a certain AST pattern and return a pointer to a node of interest inside that pattern. |
Types
Name |
Description |
Result structure of extended C++ function call matching |
|
Functions for simplifying access to SgNode information |
|
collects all pragmas with name 'pragmaName' and creates a list of all pragma strings (with stripped off prefix) and the associated SgNode. |
Functions
Name |
Description |
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. |
|
This function determines for a given function‐call‐expression its corresponding function‐definition (by using get_definingDeclaration). This function has constant complexity. It does not perform a search, but uses the information as present in the AST. If this information is not sufficient to determine the definition of a function it returns 0. For a consistent AST this will find all definitions in the same file, but not in a other SgFile. |
|
determines all VarRefExp in the subtree of 'node'. The order in the vector corresponds to the traversal order on the AST. |
|
Same as doubleQuotedEscapedString but also replaces <,<=,>=,> with the corresponding HTML codes. This is required when printing program code inside HTML tables of a dot file. |
|
computes a new string from s1 where each doublequote is replaced with a backslash followed by the doublequote. This is helpful when printing unparsed program fragments which contain doublequoted strings to a dot file (used by nodeToString). This function also replaces <,<=,>=,> with the corresponding HTML codes. |
|
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 initialized name object of a variable declaration. Otherwise it throws an exception. |
|
returns the initializer expression of a variable declaration. If no initializer exists it returns 0. |
|
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 the verbatim pragma string as it is found in the source code this string includes the leading "#pragma". |
|
return rhs of a binary node (if it is not a binary node it throws an exception) |
|
returns the SgSymbol* of the function in a SgFunctionRefExp |
|
returns the SgSymbol* of the variable in a function declaration |
|
returns the SgSymbol* of a SgInitializedName |
|
returns the SgSymbol* of the variable in a SgVarRefExp |
|
returns the SgSymbol* of the variable in a variable declaration |
|
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) |
|
returns true if the declaration has an assign initializer (e.g. char[2]="";) |
|
Checks if an OpenMP construct is marked with a nowait clause |
|
returns true if the declaration has an initializer list (e.g. char[2]={'a',0}; |
|
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) |
|
Determines if a variable is declared in global name space |
|
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; |
|
checks whether prefix 'prefix' is a prefix in string 's'. |
|
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). |
|
identifies the list of SgFunctionDefinitions in global scope Functions/methods of classes are NOT included in this list. Note: static/external can be resolved by further processing those objects |
|
identifies the list of global variables Note: static/external can be resolved by further processing those objects |
|
searches in the provided Project for SgGlobal nodes |
|
returns the set of all local variable‐declarations of a function |
|
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 for a given class/struct/union a list with the variable declarations of the member variables. Note this is a filtered list returned by the SgType::returnDataMemberPointers function which also returns pointers to methods |
|
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. |
|
replaces the ast with root 'node' with the string 's'. The string is attached to the AST and the unparser uses string s instead of unparsing this substree. This function can be used to generate C++ extensions. |
|
replaces expression e1 by expression e2. Currently it uses the SageInterface::rewriteExpression function but wraps around some addtional checks that significantly improve performance of the replace operation. |
|
replace in string 'str' each string 'from' with string 'to'. |
|
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. |
|
|
|
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. |
|
returns name of symbol as string |
|
Creates a long unique variable name for a given node of type SgVariableDeclaration or SgVarRefExp |
|
returns the string representing the condition (removes trailing ';') |
SgNodeHelper::Pattern namespace
Provides functions which match a certain AST pattern and return a pointer to a node of interest inside that pattern.
Types
Name |
Functions
Name |
Description |
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). |
StaticCFG namespace
Types
Name |
Description |
This class stores index of each node as an attribuite of SgGraphNode. |
|
A CFG implementation with Custom filters |
|
TransformationTracking namespace
Functions
Name |
Description |
Assign Ids and save current File Info. |
|
Variables
Name |
VirtualCFG namespace
Types
Name |
Description |
A control flow edge connecting two CFG nodes, with an edge condition to indicate edge types |
|
A node in the control flow graph. Each CFG node corresponds to an AST node, but there can be several CFG nodes for a given AST node. |
|
"Interesting" node and edge filters |
|
Enums
Name |
Description |
The conditions attached to edges are marked to determine which conditions trigger control to flow along that edge (as opposed to other edges out of the same source node). For conditional branches (except eckCaseLabel and eckDefault), the conditions are implicit and depend on knowledge of the particular control structure. Fortran support for this is underdeveloped; single AST nodes representing variable‐length loops was not part of the original design of the CFG code. |
Functions
Name |
Description |
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 |
|
Utility function to make CFG Edges |
|
* CALL‐BACK FUNCTIONS FOR cfgRWTransaction::transform() ** |
|
Edge printer |
|
Helper function to print Node information |
|
Print out a node plus all its outgoing edges |
|
Variables
Name |
WalrusGraph namespace
Types
Functions
Variables
arrIndexLabeler namespace
cfgUtils namespace
Functions
Name |
Description |
/ SgExpression that is that/ assignment (effectively a type cast) or NULL otherwise |
|
legacy namespace
Namespaces
Name |
Functions
Name |
Description |
Are any variables in syms modified anywhere within n, or is n a declaration of one of them? |
|
Count how many computations of expr are within root. Same caveats as expressionComputedIn. |
|
Is the expression expr computed within root? This test is simple, and does not account for changes to the variables in expr. |
legacy::PRE namespace
Types
Name |
Description |
The whole CFG structure, including some external properties |
|
Graph structure for control flow graphs. Based loosely on BGL graph type. |
|
Functions
Name |
Description |
Add information to each edge on where to insert statements on that edge. The insertion point structure is a pair of (SgNode*, bool), where the bool is true for inserting before the given node and false for inserting after it. |
|
Get the function definition containing a given node |
|
Make the control flow graph for a given node |
|
Do partial redundancy elimination on all functions within the scope n. |
|
Do partial redundancy for all expressions within a given function, whose definition is given in n. |
|
Do partial redundancy elimination, looking for copies of one expression expr within the basic block root. A control flow graph for root must be provided in cfg, with a map from nodes to their statements in node_statements, a map from edges to their CFG edge types in edge_type, and a map from edges to their insertion points in edge_insertion_point. The algorithm used is that of Paleri, Srikant, and Shankar ("Partial redundancy elimination: a simple, pragmatic, and provably correct algorithm", Science of Computer Programming 48 (2003) 1‐‐20). |
|
Print out a CFG as a dot file |
rwAccessLabeler namespace
Types
Name |
Enums
Name |
Functions
sg namespace
This namespace contains template functions that operate on the ROSE AST
Types
Name |
Description |
helper class for _ancestor |
|
projects the constness of T1 on T2 |
|
struct DefaultHandler |
|
Base class for any handlers passed to |
|
Functor copying an initialized name into a different scope |
|
Generic inserter for sage containers |
|
Functor setting the scope of a sage node to a specified (at Functor construction time) scope |
|
executes a functor for a specific node type |
|
Functor building a variable reference from an initialized name |
|
Functions
Name |
Description |
implements the ancestor search |
|
finds an ancestor node with a given type |
|
returns the same node n upcasted to its base type |
|
asserts that n has type SageNode |
|
unchecked down cast from SgNode to SageNode |
|
returns a deep copy of a sage node |
|
converts object of type E to T via string conversion |
|
creates a functor that executes code for a specific node type |
|
dereferences an object (= checked dereference in debug mode) |
|
uncovers the type of SgNode and passes it to an function "handle" in RoseVisitor. which should be overloaded with every possible target node. After the traversal, RoseVisitor should contain the intended return data. |
|
calls fn with all applicable nodes in the AST |
|
generates a SageInserter, adding elements at the end of a sequence |
|
swaps children (of equal kind) between two ancestor nodes of the same type |
|
portable implementation to avoid compiler warnings for unused parameter. |