Class VarUniqueName#
Defined in File VariableRenaming.h
Inheritance Relationships#
Base Type#
public AstAttribute(Class AstAttribute)
Class Documentation#
-
class VarUniqueName : public AstAttribute#
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 ?
Public Functions
-
inline VarUniqueName()#
Constructs the attribute with an empty key.
-
inline VarUniqueName(SgInitializedName *thisNode)#
Constructs the attribute with value thisNode.
The key will consist of only the current node.
- Parameters:
thisNode – The node to use for the key.
-
inline VarUniqueName(const std::vector<SgInitializedName*> &prefix, SgInitializedName *thisNode)#
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:
prefix – The prefix of the new name.
thisNode – The node to append to the end of the new name.
-
inline VarUniqueName(const VarUniqueName &other)#
Copy the attribute.
- Parameters:
other – The attribute to copy from.
-
inline virtual VarUniqueName *copy() const#
Virtual copy constructor.
Copy-constructs a new object on the heap and returns its pointer. All subclasses must implement this in order to instantiate the correct dynamic type, although many don’t. If this copy method returns a null pointer (like the base implementation) then the attribute is not copied as part of copying its container. E.g., an attribute stored in an AST will not be copied when the AST is copied if that attribute is directly derived from AstAttribute and fails to implement copy. If a subclass fails to implement copy and inherits from a class that does implement a copy that returns non-null, then the copied attribute will have an incorrect dynamic type.
It would be nice if we could make this pure virtual, but unfortunately ROSETTA-generated code fails to compile because it generates an instantiation of this interface (whether or not that code is ever executed is unkown). [Robb Matzke 2015-11-10]
-
inline std::vector<SgInitializedName*> &getKey()#
Get a constant reference to the name.
- Returns:
Constant Reference to the name.
-
inline void setKey(const std::vector<SgInitializedName*> &newKey)#
Set the value of the name.
- Parameters:
newKey – The new name to use.
-
inline bool getUsesThis()#
-
inline void setUsesThis(bool uses)#
-
inline std::string getNameString()#
Get the string representing this uniqueName.
- Returns:
The name string.
-
inline VarUniqueName()#