AstAttribute
Base class for all IR node attribute values.
Synopsis
Declared in <src/midend/astProcessing/AstAttributeMechanism.h>
class AstAttribute;
Types
Name |
Description |
Support for attributes to specify edges in the dot graphs. |
|
Support for adding nodes to DOT graphs. |
Enums
Name |
Description |
Who owns this attribute. |
Member Functions
Name |
Description |
|
Default constructor |
|
Destructor |
|
|
|
|
|
DOT support. |
|
Attribute class name. |
|
Eliminate IR nodes in DOT graphs. |
|
Virtual default constructor. |
|
Virtual copy constructor. |
|
Who owns this attribute. |
|
|
|
Packing support. |
|
Convert an attribute to a string. |
|
Derived Classes
Name |
Description |
** |
|
Attribute containing a regex expression as a string. |
|
IR node attribute that stores a copyable value. |
|
This class stores index of each node as an attribuite of SgGraphNode. |
|
Attribute corresponding to a metric. |
|
A persistent attribute to represent a unique name for an expression |
|
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. |
|
* numCallersAnnotator * Annotates every function's SgFunctionDefinition * node with a numCallersAttribute that contains the * number of functions that call the given function. **** |
Description
This is the base class for all attribute values stored in the Sage IR node using the AstAttributeMechanism. IR node attributes are polymorphic based on this abstract class, and are always allocated on the heap. Once the attribute value is handed to an attribute container method the container owns the value and is responsible for deleting it. In the case of methods that only optionally insert a value, the value is deleted immediately if it's not inserted. But see getOwnershipPolicy for additional information.
The underlying mechanism is designed to store values of any type, including POD, 3rd party types, and pointers. On the other hand, the AstAttributeMechanism interface described here stores only pointers to values allocated on the stack, owns those values, and supports operations that are useful specifically in IR nodes.
Subclasses should each implement a virtual copy constructor, which should allocate a new copy of the value. The implementation in this base class returns a null pointer, which means that the attribute is not copied into a new AST node when its AST node is copied. If a subclass fails to implement the virtual copy constructor and a superclass has an implementation that return non‐null, then copying the AST node will copy only the superclass part of the attribute and the new attribute will have the dynamic type of the superclass‐‐probably not what you want!
For a more detailed description of using attributes in ROSE (and your own classes) see attributes.
Created with MrDocs