ROSE
0.11.96.11
|
Class holding a unique name for a variable.
Is attached to varRefs as a persistant attribute. This is used to assign absolute names to VarRefExp nodes during VariableRenaming.
Definition at line 16 of file uniqueNameTraversal.h.
#include <uniqueNameTraversal.h>
Public Member Functions | |
VarUniqueName () | |
Constructs the attribute with an empty key. | |
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... | |
VarUniqueName * | copy () const |
Virtual copy constructor. More... | |
const 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 | |
virtual OwnershipPolicy | getOwnershipPolicy () const |
Who owns this attribute. More... | |
virtual AstAttribute * | constructor () const |
Virtual default constructor. More... | |
virtual AstAttribute * | copy () |
virtual std::string | attribute_class_name () const |
Attribute class name. More... | |
virtual std::string | toString () |
Convert an attribute to a string. More... | |
virtual bool | commentOutNodeInGraph () |
Eliminate IR nodes in DOT graphs. More... | |
virtual int | packed_size () |
Packing support. | |
virtual char * | packed_data () |
Packing support. | |
virtual void | unpacked_data (int size, char *data) |
Packing support. | |
virtual std::string | additionalNodeOptions () |
DOT support. | |
virtual std::vector< AttributeEdgeInfo > | additionalEdgeInfo () |
DOT support. | |
virtual std::vector< AttributeNodeInfo > | additionalNodeInfo () |
DOT support. | |
Additional Inherited Members | |
Public Types inherited from AstAttribute | |
enum | OwnershipPolicy { CONTAINER_OWNERSHIP, NO_OWNERSHIP, CUSTOM_OWNERSHIP, UNKNOWN_OWNERSHIP } |
Who owns this attribute. More... | |
|
inline |
Constructs the attribute with value thisNode.
The key will consist of only the current node.
thisNode | The node to use for the key. |
Definition at line 41 of file uniqueNameTraversal.h.
|
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.
prefix | The prefix of the new name. |
thisNode | The node to append to the end of the new name. |
Definition at line 54 of file uniqueNameTraversal.h.
|
inline |
Copy the attribute.
other | The attribute to copy from. |
Definition at line 64 of file uniqueNameTraversal.h.
|
inlinevirtual |
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]
Reimplemented from AstAttribute.
Definition at line 69 of file uniqueNameTraversal.h.
References VarUniqueName().
|
inline |
Get a constant reference to the name.
Definition at line 79 of file uniqueNameTraversal.h.
|
inline |
Set the value of the name.
newKey | The new name to use. |
Definition at line 88 of file uniqueNameTraversal.h.
|
inline |
Get the string representing this uniqueName.
Definition at line 107 of file uniqueNameTraversal.h.