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

Class holding a unique name for a variable. More...

#include <VariableRenaming.h>

Inheritance diagram for VarUniqueName:
Collaboration diagram for VarUniqueName:

Public Member Functions

 VarUniqueName ()
 Constructs the attribute with an empty key. More...
 
 VarUniqueName (SgInitializedName *thisNode)
 Constructs the attribute with value thisNode. More...
 
 VarUniqueName (const std::vector< SgInitializedName * > &prefix, SgInitializedName *thisNode)
 Constructs the attribute using the prefix vector and thisNode. More...
 
 VarUniqueName (const VarUniqueName &other)
 Copy the attribute. More...
 
VarUniqueNamecopy ()
 
std::vector< SgInitializedName * > & getKey ()
 Get a constant reference to the name. More...
 
void setKey (const std::vector< SgInitializedName * > &newKey)
 Set the value of the name. More...
 
bool getUsesThis ()
 
void setUsesThis (bool uses)
 
std::string getNameString ()
 Get the string representing this uniqueName. More...
 
- Public Member Functions inherited from AstAttribute
 AstAttribute ()
 
virtual ~AstAttribute ()
 
virtual std::string toString ()
 
AstAttributeconstructor ()
 
std::string attribute_class_name ()
 
virtual int packed_size ()
 
virtual char * packed_data ()
 
virtual void unpacked_data (int size, char *data)
 
virtual std::string additionalNodeOptions ()
 
virtual std::vector
< AttributeEdgeInfo
additionalEdgeInfo ()
 
virtual std::vector
< AttributeNodeInfo
additionalNodeInfo ()
 
virtual bool commentOutNodeInGraph ()
 

Private Attributes

std::vector< SgInitializedName * > key
 The vector of initializedNames that uniquely identifies this VarRef. More...
 
bool usesThis
 

Detailed Description

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.

It handles complex case like : Additional comments by Liao 5/4/2012 using this pointer: this->member_x; using member of aggregate data: e.g. a.b.c.e how about a->b->c ?

Definition at line 26 of file VariableRenaming.h.

Constructor & Destructor Documentation

VarUniqueName::VarUniqueName ( )
inline

Constructs the attribute with an empty key.

Definition at line 41 of file VariableRenaming.h.

Referenced by copy().

VarUniqueName::VarUniqueName ( SgInitializedName thisNode)
inline

Constructs the attribute with value thisNode.

The key will consist of only the current node.

Parameters
thisNodeThe node to use for the key.

Definition at line 51 of file VariableRenaming.h.

References key.

VarUniqueName::VarUniqueName ( const std::vector< SgInitializedName * > &  prefix,
SgInitializedName thisNode 
)
inline

Constructs the attribute using the prefix vector and thisNode.

The key will first be copied from the prefix value, and then the thisNode value will be appended.

Parameters
prefixThe prefix of the new name.
thisNodeThe node to append to the end of the new name.

Definition at line 64 of file VariableRenaming.h.

References key.

VarUniqueName::VarUniqueName ( const VarUniqueName other)
inline

Copy the attribute.

Parameters
otherThe attribute to copy from.

Definition at line 74 of file VariableRenaming.h.

References key.

Member Function Documentation

VarUniqueName* VarUniqueName::copy ( )
inlinevirtual

Reimplemented from AstAttribute.

Definition at line 79 of file VariableRenaming.h.

References VarUniqueName().

std::vector<SgInitializedName*>& VarUniqueName::getKey ( )
inline

Get a constant reference to the name.

Returns
Constant Reference to the name.

Definition at line 89 of file VariableRenaming.h.

References key.

void VarUniqueName::setKey ( const std::vector< SgInitializedName * > &  newKey)
inline

Set the value of the name.

Parameters
newKeyThe new name to use.

Definition at line 95 of file VariableRenaming.h.

References key.

bool VarUniqueName::getUsesThis ( )
inline

Definition at line 97 of file VariableRenaming.h.

References usesThis.

void VarUniqueName::setUsesThis ( bool  uses)
inline

Definition at line 98 of file VariableRenaming.h.

References usesThis.

std::string VarUniqueName::getNameString ( )
inline

Get the string representing this uniqueName.

Returns
The name string.

Definition at line 104 of file VariableRenaming.h.

References key, name, and usesThis.

Member Data Documentation

std::vector<SgInitializedName*> VarUniqueName::key
private

The vector of initializedNames that uniquely identifies this VarRef.

The node which this name is attached to should be the last in the list. why a vector? in order to handle a.b.c ??

Definition at line 34 of file VariableRenaming.h.

Referenced by getKey(), getNameString(), setKey(), and VarUniqueName().

bool VarUniqueName::usesThis
private

Definition at line 36 of file VariableRenaming.h.

Referenced by getNameString(), getUsesThis(), and setUsesThis().


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