ROSE  0.9.6a
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ReachingDef Class Reference

#include <reachingDef.h>

Collaboration diagram for ReachingDef:

Public Types

enum  Type {
  PHI_FUNCTION,
  ORIGINAL_DEF,
  EXPANDED_DEF
}
 
typedef boost::shared_ptr
< ReachingDef
ReachingDefPtr
 
typedef FilteredCFGEdge
< ssa_private::DataflowCfgFilter
FilteredCfgEdge
 

Public Member Functions

 ReachingDef (SgNode *defNode, Type type)
 Creates a new reaching def. More...
 
bool isPhiFunction () const
 Returns true if this is a phi function. More...
 
const std::map< ReachingDefPtr,
std::set< FilteredCfgEdge > > & 
getJoinedDefs () const
 If this is a join node (phi function), get the definitions merged. More...
 
SgNodegetDefinitionNode () const
 If this is not a phi function, returns the actual reaching definition. More...
 
std::set< SgNode * > getActualDefinitions () const
 Returns the actual reaching definitions at the current node, expanding all phi functions. More...
 
int getRenamingNumber () const
 Get the renaming (SSA index) associated with this definition. More...
 
bool isOriginalDef () const
 Returns true if this is an original definition (i.e. More...
 
bool operator== (const ReachingDef &other) const
 
void setDefinitionNode (SgNode *defNode)
 Set the definition node in the AST (only valid if this is not a phi function) More...
 
void addJoinedDef (ReachingDefPtr newDef, FilteredCfgEdge edge)
 Add a new join definition (only valid for phi functions). More...
 
void setRenamingNumber (int n)
 Set the renaming number (SSA index) of this def. More...
 

Private Attributes

Type defType
 The type of this definition. More...
 
std::map< ReachingDefPtr,
std::set< FilteredCfgEdge > > 
parentDefs
 If this is a phi node, here we store all the joined definitions and all the edges associated with each one. More...
 
SgNodethisNode
 The node at which this definition is attached. More...
 
int renamingNumer
 The values are renamed so that they increase monotonically with program flow. More...
 

Detailed Description

Definition at line 9 of file reachingDef.h.

Member Typedef Documentation

typedef boost::shared_ptr<ReachingDef> ReachingDef::ReachingDefPtr

Definition at line 26 of file reachingDef.h.

Definition at line 28 of file reachingDef.h.

Member Enumeration Documentation

Enumerator
PHI_FUNCTION 

'Fake' definition that joins two different reaching definitions.

ORIGINAL_DEF 

Definition for the actual variable in question, not a parent or child.

EXPANDED_DEF 

Definition for the parent or child of this variable.

(E.g. if x.b is the variable in question, this def could be for x or x.b.a).

Definition at line 13 of file reachingDef.h.

Constructor & Destructor Documentation

ReachingDef::ReachingDef ( SgNode defNode,
Type  type 
)

Creates a new reaching def.

Member Function Documentation

bool ReachingDef::isPhiFunction ( ) const

Returns true if this is a phi function.

const std::map<ReachingDefPtr, std::set<FilteredCfgEdge> >& ReachingDef::getJoinedDefs ( ) const

If this is a join node (phi function), get the definitions merged.

Each definition is paired with the CFG node along which it flows.

SgNode* ReachingDef::getDefinitionNode ( ) const

If this is not a phi function, returns the actual reaching definition.

If this is a phi function, returns the node where the phi function appears.

std::set<SgNode*> ReachingDef::getActualDefinitions ( ) const

Returns the actual reaching definitions at the current node, expanding all phi functions.

int ReachingDef::getRenamingNumber ( ) const

Get the renaming (SSA index) associated with this definition.

0 is the first value, and numbers increase monotonically with program flow.

bool ReachingDef::isOriginalDef ( ) const
inline

Returns true if this is an original definition (i.e.

if p.x is defined, p.x is an original defintion and p is an expanded definition)

Definition at line 74 of file reachingDef.h.

bool ReachingDef::operator== ( const ReachingDef other) const
void ReachingDef::setDefinitionNode ( SgNode defNode)

Set the definition node in the AST (only valid if this is not a phi function)

void ReachingDef::addJoinedDef ( ReachingDefPtr  newDef,
FilteredCfgEdge  edge 
)

Add a new join definition (only valid for phi functions).

void ReachingDef::setRenamingNumber ( int  n)

Set the renaming number (SSA index) of this def.

Member Data Documentation

Type ReachingDef::defType
private

The type of this definition.

Definition at line 32 of file reachingDef.h.

std::map<ReachingDefPtr, std::set<FilteredCfgEdge> > ReachingDef::parentDefs
private

If this is a phi node, here we store all the joined definitions and all the edges associated with each one.

Definition at line 36 of file reachingDef.h.

SgNode* ReachingDef::thisNode
private

The node at which this definition is attached.

If it's not a phi a function, then this is the defining node of the variable.

Definition at line 40 of file reachingDef.h.

int ReachingDef::renamingNumer
private

The values are renamed so that they increase monotonically with program flow.

0 is the first value.

Definition at line 43 of file reachingDef.h.


The documentation for this class was generated from the following file: