Skip to content

AstValueAttribute

IR node attribute that stores a copyable value.

Synopsis

Declared in <src/midend/astProcessing/AstAttributeMechanism.h>

template<class T>
class AstValueAttribute
    : public AstAttribute

Base Classes

Name

Description

AstAttribute

Base class for all IR node attribute values.

Types

Name

Description

Value

Type of value this wrapper holds.

Member Functions

Name

Description

AstValueAttribute [constructor]

Constructors

attribute_class_name [virtual]

copy [virtual]

get

Return the stored value by reference.

set

Assign a new value.

Private Data Members

Name

value_

Derived Classes

Name

Description

AstIntAttribute

AstSgNodeAttribute

Attribute storing an SgNode.

Description

Since IR node attributes must all inherit from AstAttribute we need to write wrappers around POD types and 3rd party types when we want to store them as IR attributes. We've ended up with a proliferation of such attributes that all do almost the same thing but have different names to access their data members. Hopefully by providing one class template we can avoid further proliferation.

Created with MrDocs