Public Member Functions | List of all members
ssa_private::VarUniqueName Class Reference


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 <midend/programAnalysis/staticSingleAssignment/uniqueNameTraversal.h>

Inheritance diagram for ssa_private::VarUniqueName:
Inheritance graph
Collaboration diagram for ssa_private::VarUniqueName:
Collaboration graph

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...
VarUniqueNamecopy () 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 AstAttributeconstructor () const
 Virtual default constructor. More...
virtual AstAttributecopy ()
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< AttributeEdgeInfoadditionalEdgeInfo ()
 DOT support.
virtual std::vector< AttributeNodeInfoadditionalNodeInfo ()
 DOT support.

Additional Inherited Members

- Public Types inherited from AstAttribute
enum  OwnershipPolicy {
 Who owns this attribute. More...

Constructor & Destructor Documentation

ssa_private::VarUniqueName::VarUniqueName ( SgInitializedName thisNode)

Constructs the attribute with value thisNode.

The key will consist of only the current node.

thisNodeThe node to use for the key.

Definition at line 41 of file uniqueNameTraversal.h.

ssa_private::VarUniqueName::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.

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

Definition at line 54 of file uniqueNameTraversal.h.

ssa_private::VarUniqueName::VarUniqueName ( const VarUniqueName other)

Copy the attribute.

otherThe attribute to copy from.

Definition at line 64 of file uniqueNameTraversal.h.

Member Function Documentation

VarUniqueName* ssa_private::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]

Reimplemented from AstAttribute.

Definition at line 69 of file uniqueNameTraversal.h.

References VarUniqueName().

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

Get a constant reference to the name.

Constant Reference to the name.

Definition at line 79 of file uniqueNameTraversal.h.

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

Set the value of the name.

newKeyThe new name to use.

Definition at line 88 of file uniqueNameTraversal.h.

std::string ssa_private::VarUniqueName::getNameString ( )

Get the string representing this uniqueName.

The name string.

Definition at line 107 of file uniqueNameTraversal.h.

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