VariableRenaming
Class that defines an VariableRenaming of a program
Synopsis
Declared in <src/midend/programAnalysis/variableRenaming/VariableRenaming.h>
class VariableRenaming;
Types
Name |
Description |
A table storing the name‐>node mappings for every node in the program. |
|
A table mapping a name to a single node. |
|
A vector of SgInitializedName* |
|
An entry in the rename table that maps a node to a number. |
|
A table that maps a name to it's node‐>number renamings. |
|
Vector of SgNode* |
|
An entry in the rename table that maps a number to a node. |
|
A table that maps a name to it's number‐>node renamings. |
|
An entry in the rename table mapping a name to a nodeVec. |
|
A compound variable name as used by the variable renaming. |
|
A filtered CFGEdge that is used for DefUse traversal. |
|
A vector of cfgEdges. |
|
A filtered CFGNode that is used for DefUse traversal. |
|
A vector of cfgNodes. |
Member Functions
Name |
Description |
|
Construct from |
|
Destructor |
|
|
Get the table of definitions for every node. |
|
Get name:num mapping for all defs at the given node. |
|
Get name:num mapping for def of the specified variable at the given node. |
|
Get all definitions for the subtree rooted at this node. If m.x is defined, the resulting table will also include a definition for m. |
|
Get name:num mapping for all expanded defs at the given node. |
|
Get name:num mapping for def of the specified variable at the given node. |
|
Get the number of the last rename of the given variable. |
|
Get the node that defines the given number of the given variable. |
|
Get name:num mapping for all original defs at the given node. |
|
Get name:num mapping for def of the specified variable at the given node. |
|
Get all original definitions for the subtree rooted at this node. No expanded definitions will be included ‐ for example, if m.x is defined, there will be no definition for the structure m. |
|
Get name:num mappings for the original uses at this node. For example, if p.x appears, there will be a use for p.x, but not for p. |
|
Get the defTable containing the propogated definition information. |
|
Get the final versions if all variables at the end of the given function. |
|
Get the versions of a variable at the end of the given function. |
|
Get the versions of all variables at the start of the given function. |
|
Get the versions of a variable at the start of the given function. |
|
Get name:num mappings for all reaching definitions of all variables at the node. |
|
Get name:num mapping for all reaching definitions of the given variable at the node. |
|
Get the final versions if all variables at the end of the given scope. |
|
Gets the versions of all variables reaching a statment before its execution. Notice that this method and getReachingDefsAtNode potentially return different values for loops. With loops, variable values from the body of the loop flow to the top; hence getReachingDefsAtNode returns definitions from the loop body. On the other hand, getReachingDefsAtStatementStart does not return definitions coming in from a loop body. |
|
Get the rename number for the given variable and the given node. |
|
Get the table of uses for every node. |
|
Get name:num mappings for all uses at this node. For example, if p.x appears, there will be a use for both p and p.x |
|
Get name:num mapping for use of the given variable at this node. |
|
Print the CFG with any UniqueNames and Def/Use information visible. |
|
Print the CFG with any UniqueNames and Def/Use information visible. |
Static Member Functions
Name |
Description |
Get an AST fragment containing the appropriate varRefs and Dot/Arrow ops to access the given variable. |
|
Get the uniqueName attribute for the given node. |
|
Get the variable name of the given node. |
|
Gets whether or not the function is from a library. |
|
Find if the given prefix is a prefix of the given name. |
|
Get a string representation of a varName. |
|
Static Data Members
Name |
Description |
This represents the initializedName for the 'this' keyword. |
|
Tag to use to retrieve unique naming key from node. |
Private Types
Name |
Description |
Attribute that describes the variables used by a given expression. |
|
This class collects all the defs and uses associated with each node in the traversed CFG. Note that this does not compute reachability information; it just records each instance of a variable used or defined. |
|
Class to traverse the AST and assign unique names to every varRef. |
|
Attribute that describes the variables modified by a given expression. |
Private Member Functions
Name |
Description |
Add an entry to the renumbering table for the given var and node. |
|
Trace backwards in the cfg one step and return an aggregate of all previous defs. |
|
Expand all member definitions (chained names) to define every name in the chain. |
|
Expand all member uses (chained names) to explicitly use every name in the chain. |
|
Returns a set of all the variables names that have uses in the subtree. |
|
Insert defs for functions that are declared outside the function scope. |
|
Insert defs for member uses (chained names) that do not have an explicit def. |
|
Called to merge the defs from previous nodes in the CFG to this one. |
|
Called to update the uses on the current node. |
|
Private Data Members
Name |
Description |
This is the table that is populated with all the def information for all the variables at all the nodes. It is populated during the runDefUse function, and is done with the steady‐state dataflow algorithm. |
|
This is the table of definitions that is expanded from the original table. It is used to populate the actual def/use table. |
|
Holds a list of the locations that a particular name is first defined. |
|
This holds the mapping between variables and the nodes where they are renumbered. Given a name and a node, we can get the number of the name that is defined at that node. Nodes which do not define a name are not in the table. |
|
This holds the mapping between variables and the nodes where they are renumbered. Given a name and a number, we can get the node where that number is defined. Nodes which do not define a name are not in the table. |
|
This is the table of variable definition locations that is generated by the VarDefUseTraversal. It is later used to populate the actual def/use table. |
|
The project to perform SSA Analysis on. |
|
This is the table that is populated with all the use information for all the variables at all the nodes. It is populated during the runDefUse function, and is done with the steady‐state dataflow algorithm. |
Description
Contains all the functionality to implement variable renaming on a given program. For this class, we do not actually transform the AST directly, rather we perform the analysis and add attributes to the AST nodes so that later optimizations can access the results of this analysis while still preserving the original AST.
Created with MrDocs