SgType¶
This class represents the base class for all types.
Synopsis¶
Declared in <src/frontend/SageIII/Cxx_Grammar.h> (not stored in Git)
class [[visibility("default")]] SgType
: public SgNode Description¶
There are no uses of this IR node anywhere. All SgType based IR nodes are derived from this SgType class. Discussion of get_base_type() and findBaseType():
-
fileBaseType() will recursively strip away all typedefs, reference, pointers, arrays, and modifiers
-
get_base_type() is a member function on some IR nodes derived from SgType and returns the non-recursively striped (immediate) type under the typedefs, reference, pointers, arrays, modifiers, etc.
- Internal: This is a base class for all SgType objects.
-
Todo: Several classes derived from SgType are not used and can be removed:
-
SgTypeUnknown (Used by SageInterface to specify references to undeclared variables)
-
SgUnknownMemberFunctionType
- Todo: Labels appear to be used as types in "foo(,)", see example from Chris (LANL, 4/19/2007).
- See also: Example of using a SgType object
Data members
SgReferenceType SgType::p_ref_to¶
This holds the pointer to a SgReferenceType if this type is a reference to another type.
SgPointerType SgType::p_ptr_to¶
This holds the pointer to a SgPointerType if this type is a pointer to another type.
SgReferenceType SgType::p_modifiers¶
This points to any SgModifierNodes if this type contains type modifiers.
Base Classes¶
| Name | Description |
|---|---|
SgNode | This class represents the base class for all IR nodes within Sage III. |
Type Aliases¶
| Name |
|---|
base_node_type |
Enums¶
| Name | Description |
|---|---|
Unnamed enum | static variant value |
fortran_attribute_specifiers_enum |
Member Functions¶
| Name | Description |
|---|---|
SgTypeSgType(); [constructor] | Constructors |
~SgTypevirtual ~SgType(); [destructor] [virtual] | Destructor |
acceptvirtual void accept(ROSE_VisitorPattern& visitor) override; [virtual] | support for the classic visitor pattern done in GoF |
addNewAttributevirtual void addNewAttribute( std::string s, AstAttribute* a) override; [virtual] | Add a new attribute represented by the named string. |
appendDestructorOwnedNodesvirtual void appendDestructorOwnedNodes(std::vector<SgNode*>& nodes) const override; [virtual] | |
attributeExistsvirtual bool attributeExists(std::string s) const override; [virtual] | Tests if attribute of name 's' is present. |
class_namevirtual std::string class_name() const override; [virtual] | returns a string representing the class name |
containsInternalTypesbool containsInternalTypes(); | Some types can hide other type IR nodes internally. This function is true if it can hide another type (pointer, array, etc.). |
copyvirtual SgNode* copy(SgCopyHelp& help) const override; [virtual] | |
dereferenceSgType* dereference(); | |
findBaseTypeSgType* findBaseType() const; | Return the base type of the associated type. The base type is important when dealing with pointers, arrays, etc. |
getAssociatedDeclarationSgDeclarationStatement* getAssociatedDeclaration() const; | |
getAttributevirtual AstAttribute* getAttribute(std::string s) const override; [virtual] | Returns attribute of name 's'. |
getInternalTypesstd::vector<SgType*> getInternalTypes() const; | Generate a container of types hidden in the input type. |
get_ast_json_type_identityuint64_t get_ast_json_type_identity() const; | |
get_attributeMechanismvirtual AstAttributeMechanism* get_attributeMechanism() const override; [virtual] | |
get_childIndexvirtual size_t get_childIndex(SgNode* child) const override; [virtual] | index-based access to traversal successors by child node |
get_fortran_fixed_kind_valueint64_t get_fortran_fixed_kind_value() const; | |
get_fortran_fixed_kind_value_is_availablebool get_fortran_fixed_kind_value_is_available() const; | |
get_fortran_source_syntaxbool get_fortran_source_syntax() const; | |
get_hasTypeKindStarbool get_hasTypeKindStar() const; | |
get_isCoArraybool get_isCoArray() const; | |
get_mangledvirtual SgName get_mangled() const; [virtual] | Returns a mangled string representation of this type. Equivalent types have the same mangled string. |
get_modifiersSgModifierNodes* get_modifiers() const; | |
get_numberOfTraversalSuccessorsvirtual size_t get_numberOfTraversalSuccessors() const override; [virtual] | return number of children in the traversal successor list |
get_ptr_toSgPointerType* get_ptr_to() const; | |
get_ref_toSgReferenceType* get_ref_to() const; | |
get_rvalue_ref_toSgRvalueReferenceType* get_rvalue_ref_to() const; | |
get_traversalSuccessorByIndexvirtual SgNode* get_traversalSuccessorByIndex(size_t idx) const override; [virtual] | index-based access to traversal successors by index number |
get_traversalSuccessorContainervirtual std::vector<SgNode*> get_traversalSuccessorContainer() const override; [virtual] | container of pointers to AST successor nodes used in the traversal overridden in every class by generated implementation |
get_traversalSuccessorIsListElementvirtual std::vector<bool> get_traversalSuccessorIsListElement() const override; [virtual] | |
get_traversalSuccessorNamesContainervirtual std::vector<std::string> get_traversalSuccessorNamesContainer() const override; [virtual] | container of names of variables or container indices used used in the traversal to access AST successor nodes overridden in every class by generated implementation |
get_type_kindvirtual SgExpression* get_type_kind() const; [virtual] | |
hasExplicitTypebool hasExplicitType(); | Some types store internal SgType pointers explicitly while others compute them from other data. This function is true if it has a data member that is a type (pointer, array, etc.). |
has_source_prototypebool has_source_prototype() const; | |
isEquivalentTypebool isEquivalentType(SgType const* other_type) const; | Type equivalence is the concept of equality between types independent of access permissions (e.g. private or protected types in a class). |
isFloatTypebool isFloatType() const; | |
isIntegerTypebool isIntegerType() const; | |
isPrimativeTypebool isPrimativeType() const; | |
isUnsignedTypebool isUnsignedType() const; | Compute numerical properties of type. |
numberOfAttributesvirtual int numberOfAttributes() const override; [virtual] | Returns the number of attributes on this IR node. |
operator deletevoid operator delete( void* pointer, size_t size); | deallocated memory for IR node (returns memory to memory pool for reuse) |
operator newvoid* operator new(size_t size); | returns pointer to newly allocated IR node |
post_construction_initializationvirtual void post_construction_initialization() override; [virtual] | |
processDataMemberReferenceToPointersvirtual void processDataMemberReferenceToPointers(ReferenceToPointerHandler*) override; [virtual] | Pass references to stored node pointers to a handler. |
removeAttributevirtual void removeAttribute(std::string s) override; [virtual] | Remove attribute of name 's' if present. |
returnDataMemberPointersvirtual std::vector<std::pair<SgNode*, std::string>> returnDataMemberPointers() const override; [virtual] | Return the node pointers stored in this node's data members. |
roseRTIvirtual RTIReturnType roseRTI() override; [virtual] | return C++ Runtime-Time-Information |
sage_class_namevirtual char const* sage_class_name() const override; [virtual] | returns a C style string (char*) representing the class name |
setAttributevirtual void setAttribute( std::string s, AstAttribute* a) override; [virtual] | This is a wrapper function with the following semantics: if no attribute of name 's' exists then addNewAttribute(s,a); is called, otherwise updateAttribute(s,a); is called. |
set_ast_json_type_identityvoid set_ast_json_type_identity(uint64_t identity); | |
set_attributeMechanismvirtual void set_attributeMechanism(AstAttributeMechanism* attributeMechanism) override; [virtual] | |
set_fortran_fixed_kind_valuevoid set_fortran_fixed_kind_value(int64_t fortran_fixed_kind_value); | |
set_fortran_fixed_kind_value_is_availablevoid set_fortran_fixed_kind_value_is_available(bool fortran_fixed_kind_value_is_available); | |
set_fortran_source_syntaxvoid set_fortran_source_syntax(bool fortran_source_syntax); | |
set_hasTypeKindStarvoid set_hasTypeKindStar(bool hasTypeKindStar); | |
set_isCoArrayvoid set_isCoArray(bool isCoArray); | |
set_modifiersvoid set_modifiers(SgModifierNodes* modifiers); | |
set_ptr_tovoid set_ptr_to(SgPointerType* ptr_to); | |
set_ref_tovoid set_ref_to(SgReferenceType* ref_to); | |
set_rvalue_ref_tovoid set_rvalue_ref_to(SgRvalueReferenceType* rvalue_ref_to); | |
set_type_kindvirtual void set_type_kind(SgExpression* type_kind); [virtual] | |
stripTypeSgType* stripType(unsigned char bit_array = STRIP_MODIFIER_TYPE | STRIP_REFERENCE_TYPE | STRIP_RVALUE_REFERENCE_TYPE | STRIP_POINTER_TYPE | STRIP_ARRAY_TYPE | STRIP_TYPEDEF_TYPE | STRIP_POINTER_MEMBER_TYPE | STRIP_DECLTYPE_TYPE) const; | Returns hidden type beneath layers of typedefs, pointers, references, modifiers, array representation, etc. |
stripTypedefsAndModifiersSgType* stripTypedefsAndModifiers() const; | This only strips away typedefs and modifiers (specialized usage). |
updateAttributevirtual void updateAttribute( std::string s, AstAttribute* a) override; [virtual] | Replace existing attribute of name 's' with new AstAttribute. |
variantTvirtual VariantT variantT() const override; [virtual] | returns new style SageIII enum values |
Static Member Functions¶
| Name | Description |
|---|---|
memoryUsagestatic size_t memoryUsage(); | Returns the size in bytes of the total memory allocated for all IR nodes of this type |
numberOfNodesstatic size_t numberOfNodes(); | Returns the total number of IR nodes of this type |
traverseMemoryPoolNodesstatic void traverseMemoryPoolNodes(ROSE_VisitTraversal& visit); | FOR INTERNAL USE Support for visitor pattern over all IR nodes by type of IR node. |
traverseMemoryPoolVisitorPatternstatic void traverseMemoryPoolVisitorPattern(ROSE_VisitorPattern& visitor); | FOR INTERNAL USE Support for visitor pattern. |
visitRepresentativeNodestatic void visitRepresentativeNode(ROSE_VisitTraversal& visit); | FOR INTERNAL USE Support for type-based traversal. |
Static Data Members¶
| Name | Description |
|---|---|
STRIP_ARRAY_TYPE | |
STRIP_DECLTYPE_TYPE | |
STRIP_MODIFIER_TYPE | |
STRIP_POINTER_MEMBER_TYPE | |
STRIP_POINTER_TYPE | |
STRIP_REFERENCE_TYPE | |
STRIP_RVALUE_REFERENCE_TYPE | |
STRIP_TYPEDEF_TYPE | |
free_slots | Free slots, each numbered pool_index * pool_size + slot_index. The last entry is allocated next. |
pool_live_flags | |
pool_size | |
pools |
Protected Data Members¶
Friends¶
| Name | Description |
|---|---|
isSgType | Casts pointer from base class to derived class (for const pointers) |
isSgType | Casts pointer from base class to derived class |
SgUnaryTransformType | |
SgTypeOfType | |
SgTypedefType | |
SgDeclType | |
SgRvalueReferenceType | |
SgReferenceType | |
SgPointerType |
Derived Classes¶
| Name | Description |
|---|---|
SgArrayType | |
SgAutoType | |
SgDeclType | |
SgFloatingPointType | |
SgFunctionType | This class represents a type for all functions. |
SgIntegralType | |
SgModifierType | |
SgNamedType | |
SgPointerType | |
SgReferenceType | |
SgRvalueReferenceType | |
SgTemplateType | |
SgTypeComplex | This class represents a C99 complex type. |
SgTypeCrayPointer | |
SgTypeDefault | A placeholder type. |
SgTypeDependent | |
SgTypeEllipse | |
SgTypeFortranAssumed | |
SgTypeFortranBOZ | |
SgTypeFortranUnlimitedPolymorphic | |
SgTypeGlobalVoid | |
SgTypeImaginary | This class represents a C99 complex type. |
SgTypeLabel | |
SgTypeNullptr | |
SgTypeOfType | |
SgTypeString | This class represents a string type used for SgStringVal IR node. |
SgTypeTargetBuiltin | |
SgTypeUnknown | |
SgTypeVoid | |
SgUnaryTransformType |
Created with MrDocs