SgTypedefDeclaration¶
This class represents the notion of a typedef declaration.
Synopsis¶
Declared in <src/frontend/SageIII/Cxx_Grammar.h> (not stored in Git)
class [[visibility("default")]] SgTypedefDeclaration
: public SgDeclarationStatement Description¶
Typedefs define new types for use in variable declarations, function parameter lists, etc. Typically the base type is complex and the typedef name allows the more complex types use to be made easier to read.
- Todo: There are a few data members in this field that don't appear to be used (should be removed if not required):
- p_declaration: have not seen it be used anywhere (I think it is used when a declartion is explicit in the typedef, check this out, might be part of older mechanism before defining and nondefining declarations were developed to provide a uniform mechanism for all declarations)
- See also: Example of using a SgTypedefDeclaration object
Data members
SgName SgTypedefDeclaration::p_name¶
This is the name of the newly defined type.
- Internal: This name carries no qualification.
SgType SgTypedefDeclaration::p_base_type¶
This is the type being given a new name by the typedef declaration.
- Internal: This name can be private so using the base type directly can cause access violations within generated code.
SgTypedefType SgTypedefDeclaration::p_type¶
This is the resulting type defined by the typedef declaration. This type can be used where any type can be use, declaration of variables, etc.
- Internal: Because of access privileges on the typedef declaration the resulting type can have access restrictions.
SgDeclarationStatement SgTypedefDeclaration::p_declaration¶
pointer to the declaration (typically a SgClassDeclaration). A typedef such as "typedef struct {int __pos; int __state;} _G_fpos64_t;" defines a class as part of its declaration. p_declaration pointes to the declaration in these cases.
- Internal: This is the class declaration in a typedef that defines a class.
`bool¶
SgTypedefDeclaration::p_typedefBaseTypeContainsDefiningDeclaration` This flag indicates that the typedef defines a structure typedefExample.C This example show the definition of a struct within the typedef.
- Internal: I would like to give this a better name.
SgScopeStatement SgTypedefDeclaration::p_scope¶
This is the scope of the typedef declaration.
- Internal: Comment on why we need to store the scope explicitly (resolves name qualification issues).
Member functions
SgTypedefDeclaration::get_scope() const¶
Returns scope of current statement. Returns the explicit semantic scope for declarations that store one, or the scope defined by the owning AST structure for other statements. Producers establish those identities during construction. Function parameter scopes follow their owning declaration's signature or definition role.
- Return: Returns valid pointer to SgScopeStatement.
Base Classes¶
| Name | Description |
|---|---|
SgDeclarationStatement | This class represents the concept of a declaration statement. |
Type Aliases¶
| Name |
|---|
base_node_type |
Enums¶
| Name | Description |
|---|---|
Unnamed enum | static variant value |
typedef_type_enum |
Member Functions¶
| Name | Description |
|---|---|
SgTypedefDeclarationSgTypedefDeclaration( SgName name, SgType* base_type, SgTypedefType* type, SgDeclarationStatement* declaration); [constructor] | Constructors |
~SgTypedefDeclarationvirtual ~SgTypedefDeclaration(); [destructor] [virtual] | Destructor |
acceptvirtual void accept(ROSE_VisitorPattern& visitor) override; [virtual] | support for the classic visitor pattern done in GoF |
appendDestructorOwnedNodesvirtual void appendDestructorOwnedNodes(std::vector<SgNode*>& nodes) const override; [virtual] | |
class_namevirtual std::string class_name() const override; [virtual] | returns a string representing the class name |
copyvirtual SgNode* copy(SgCopyHelp& help) const override; [virtual] | |
fixupCopy_referencesvirtual void fixupCopy_references( SgNode* copy, SgCopyHelp& help) const override; [virtual] | |
fixupCopy_scopesvirtual void fixupCopy_scopes( SgNode* copy, SgCopyHelp& help) const override; [virtual] | |
fixupCopy_symbolsvirtual void fixupCopy_symbols( SgNode* copy, SgCopyHelp& help) const override; [virtual] | |
get_baseTypeDefiningDeclarationSgDeclarationStatement* get_baseTypeDefiningDeclaration() const; | Returns the exact defining tag declaration structurally owned by this typedef, or NULL when the base type is only referenced or this typedef owns a nondefining tag introduction. |
get_baseTypeNondefiningDeclarationSgDeclarationStatement* get_baseTypeNondefiningDeclaration() const; | Returns the exact nondefining tag introduction structurally owned by this typedef, or NULL when the base type is only referenced or this typedef owns an inline tag definition. |
get_base_typeSgType* get_base_type() const; | |
get_childIndexvirtual size_t get_childIndex(SgNode* child) const override; [virtual] | index-based access to traversal successors by child node |
get_declarationSgDeclarationStatement* get_declaration() const; | |
get_global_qualification_requiredbool get_global_qualification_required() const; | |
get_global_qualification_required_for_base_typebool get_global_qualification_required_for_base_type() const; | |
get_isAssociatedWithDeclarationListbool get_isAssociatedWithDeclarationList() const; | |
get_isAutonomousDeclarationbool get_isAutonomousDeclaration() const; | |
get_mangled_namevirtual SgName get_mangled_name() const override; [virtual] | |
get_nameSgName get_name() const; | |
get_name_qualification_lengthint get_name_qualification_length() const; | |
get_name_qualification_length_for_base_typeint get_name_qualification_length_for_base_type() const; | |
get_numberOfTraversalSuccessorsvirtual size_t get_numberOfTraversalSuccessors() const override; [virtual] | return number of children in the traversal successor list |
get_qualified_namevirtual SgName get_qualified_name() const; [virtual] | |
get_requiresGlobalNameQualificationOnTypebool get_requiresGlobalNameQualificationOnType() const; | |
get_scopevirtual SgScopeStatement* get_scope() const override; [virtual] | |
get_source_base_type_global_qualificationbool get_source_base_type_global_qualification() const; | |
get_source_base_type_qualification_presentbool get_source_base_type_qualification_present() const; | |
get_source_base_type_qualification_tokensSgStringList const& get_source_base_type_qualification_tokens() const; | |
get_symbol_from_symbol_tablevirtual SgSymbol* get_symbol_from_symbol_table() const override; [virtual] | |
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_typeSgTypedefType* get_type() const; | |
get_type_elaboration_requiredbool get_type_elaboration_required() const; | |
get_type_elaboration_required_for_base_typebool get_type_elaboration_required_for_base_type() const; | |
get_typedefBaseTypeContainsDefiningDeclarationbool get_typedefBaseTypeContainsDefiningDeclaration() const; | |
get_typedef_typeSgTypedefDeclaration::typedef_type_enum get_typedef_type() const; | |
hasExplicitScopevirtual bool hasExplicitScope() const override; [virtual] | Support for where the scope is explicitly required |
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. |
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 |
set_base_typevoid set_base_type(SgType* base_type); | |
set_declarationvoid set_declaration(SgDeclarationStatement* declaration); | |
set_global_qualification_requiredvoid set_global_qualification_required(bool global_qualification_required); | |
set_global_qualification_required_for_base_typevoid set_global_qualification_required_for_base_type(bool global_qualification_required_for_base_type); | |
set_isAssociatedWithDeclarationListvoid set_isAssociatedWithDeclarationList(bool isAssociatedWithDeclarationList); | |
set_isAutonomousDeclarationvoid set_isAutonomousDeclaration(bool isAutonomousDeclaration); | |
set_namevoid set_name(SgName name); | |
set_name_qualification_lengthvoid set_name_qualification_length(int name_qualification_length); | |
set_name_qualification_length_for_base_typevoid set_name_qualification_length_for_base_type(int name_qualification_length_for_base_type); | |
set_requiresGlobalNameQualificationOnTypevoid set_requiresGlobalNameQualificationOnType(bool requiresGlobalNameQualificationOnType); | |
set_scopevirtual void set_scope(SgScopeStatement* scope) override; [virtual] | |
set_source_base_type_global_qualificationvoid set_source_base_type_global_qualification(bool source_base_type_global_qualification); | |
set_source_base_type_qualification_presentvoid set_source_base_type_qualification_present(bool source_base_type_qualification_present); | |
set_typevoid set_type(SgTypedefType* type); | |
set_type_elaboration_requiredvoid set_type_elaboration_required(bool type_elaboration_required); | |
set_type_elaboration_required_for_base_typevoid set_type_elaboration_required_for_base_type(bool type_elaboration_required_for_base_type); | |
set_typedefBaseTypeContainsDefiningDeclarationvoid set_typedefBaseTypeContainsDefiningDeclaration(bool typedefBaseTypeContainsDefiningDeclaration); | |
set_typedef_typevoid set_typedef_type(SgTypedefDeclaration::typedef_type_enum typedef_type); | |
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 |
|---|---|
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 Member Functions¶
| Name | Description |
|---|---|
cfgInEdgesvirtual std::vector<VirtualCFG::CFGEdge> cfgInEdges(unsigned int index) override; [virtual] | |
cfgIndexForEndvirtual unsigned int cfgIndexForEnd() const override; [virtual] | |
cfgOutEdgesvirtual std::vector<VirtualCFG::CFGEdge> cfgOutEdges(unsigned int index) override; [virtual] | |
compute_baseTypeDefiningDeclarationSgDeclarationStatement* compute_baseTypeDefiningDeclaration() const; | Internal support for traversal of the exact structurally owned base tag. Despite the legacy name, this returns either the defining or nondefining owned tag. Referenced declarations are never traversal children. |
replace_childvirtual bool replace_child( SgStatement*, SgStatement*, bool extractListFromBasicBlock = false) override; [virtual] |
Protected Data Members¶
Friends¶
| Name | Description |
|---|---|
isSgTypedefDeclaration | Casts pointer from base class to derived class (for const pointers) |
isSgTypedefDeclaration | Casts pointer from base class to derived class |
Derived Classes¶
| Name | Description |
|---|---|
SgTemplateInstantiationTypedefDeclaration | |
SgTemplateTypedefDeclaration |
Created with MrDocs