ROSE
0.9.6a
|
Class to traverse the AST and assign unique names to every varRef. More...
#include <uniqueNameTraversal.h>
Public Member Functions | |
UniqueNameTraversal (const std::vector< SgInitializedName * > &allNames, bool treatPointersAsStructs=true, bool propagateNamesThroughComma=true) | |
virtual VariableReferenceSet | evaluateSynthesizedAttribute (SgNode *node, SynthesizedAttributesList attrs) |
Called to evaluate the synthesized attribute on every node. More... | |
![]() | |
VariableReferenceSet | traverse (SgNode *node) |
evaluates attributes on the entire AST More... | |
VariableReferenceSet | traverseWithinFile (SgNode *node) |
evaluates attributes only at nodes which represent the same file as where the evaluation was started More... | |
void | traverseInputFiles (SgProject *projectNode) |
evaluates attributes only at nodes which represent files which were specified on the command line (=input files). More... | |
![]() | |
VariableReferenceSet | traverse (SgNode *basenode, DummyAttributeinheritedValue, t_traverseOrder travOrder=preandpostorder) |
VariableReferenceSet | traverseWithinFile (SgNode *basenode, DummyAttributeinheritedValue, t_traverseOrder travOrder=preandpostorder) |
void | traverseInputFiles (SgProject *projectNode, DummyAttributeinheritedValue, t_traverseOrder travOrder=preandpostorder) |
virtual | ~SgTreeTraversal () |
SgTreeTraversal () | |
SgTreeTraversal (const SgTreeTraversal &) | |
const SgTreeTraversal & | operator= (const SgTreeTraversal &) |
Static Public Attributes | |
static std::string | varKeyTag |
Tag to use to retrieve unique naming key from node. More... | |
Private Member Functions | |
SgInitializedName * | resolveTemporaryInitNames (SgInitializedName *name) |
Finds initialized names that are "fake" (refer to p_prev_decl_item in the SgInitializedName docs) and replaces them with the true declaration. More... | |
Private Attributes | |
std::vector< SgInitializedName * > | allInitNames |
All the initialized names in the project. More... | |
const bool | treatPointersAsStructs |
If true, expressions such as p->x will be chained together in a variable name p.x Turning on this option reduces safety of analyses. More... | |
const bool | propagateNamesThroughComma |
If true, expressions such as (a, b).x will be named as b.x. More... | |
Additional Inherited Members | |
![]() | |
typedef AstSuccessorsSelectors::SuccessorsContainer | SuccessorsContainer |
typedef SuccessorsContainer & | SuccessorsContainerRef |
![]() | |
virtual VariableReferenceSet | defaultSynthesizedAttribute () |
Allows to provide a default value for a synthesized attribute of primitive type (e.g. More... | |
virtual void | atTraversalStart () |
Function called at the start of the traversal, before any node is visited; override if necessary, the default implementation is a no-op. More... | |
virtual void | atTraversalEnd () |
Class to traverse the AST and assign unique names to every varRef.
Definition at line 149 of file uniqueNameTraversal.h.
typedef std::vector<SgInitializedName*> ssa_private::UniqueNameTraversal::VarName |
A compound variable name as used by the variable renaming.
Definition at line 172 of file uniqueNameTraversal.h.
|
inline |
treatPointersAsStructs | If true, expressions such as p->x will be chained together in a variable name p.x |
propagateNamesThroughComma | If true, expressions such as (a, b).x will be named as b.x. |
Definition at line 177 of file uniqueNameTraversal.h.
|
private |
Finds initialized names that are "fake" (refer to p_prev_decl_item in the SgInitializedName docs) and replaces them with the true declaration.
|
virtual |
Called to evaluate the synthesized attribute on every node.
This function will handle passing all variables that are referenced by a given expression.
node | The node being evaluated. |
attrs | The attributes from the child nodes. |
Implements AstBottomUpProcessing< VariableReferenceSet >.
|
private |
All the initialized names in the project.
Definition at line 152 of file uniqueNameTraversal.h.
|
private |
If true, expressions such as p->x will be chained together in a variable name p.x Turning on this option reduces safety of analyses.
Definition at line 160 of file uniqueNameTraversal.h.
|
private |
If true, expressions such as (a, b).x will be named as b.x.
This allows detecting more defs, but if the left-hand side of a comma has modifying side effects it may reduce the safety of an analysis.
Definition at line 164 of file uniqueNameTraversal.h.
|
static |
Tag to use to retrieve unique naming key from node.
Definition at line 169 of file uniqueNameTraversal.h.