PandA-2024.02
Public Types | Public Member Functions | Data Fields
record_type Struct Reference

struct definition of the record_type tree node. More...

#include <tree_node.hpp>

Inheritance diagram for record_type:
Inheritance graph
[legend]
Collaboration diagram for record_type:
Collaboration graph
[legend]

Public Types

enum  {
  GETID =(type_node) = 0, GETID =(type_node) = 0, GETID =(type_node) = 0, GETID =(type_node) = 0,
  GETID =(type_node) = 0, GETID =(type_node) = 0, GETID =(type_node) = 0, GETID =(type_node) = 0,
  GETID =(type_node) = 0
}
 visitor enum More...
 
- Public Types inherited from type_node
enum  { GETID =(tree_node) = 0, GETID =(tree_node) = 0, GETID =(tree_node) = 0, GETID =(tree_node) = 0 }
 visitor enum More...
 

Public Member Functions

 record_type (unsigned int i)
 constructor More...
 
void add_flds (const tree_nodeRef &a)
 Add a field_decl to list of flds. More...
 
void add_fncs (const tree_nodeRef &a)
 Add a methods_decl to list of fncs. More...
 
tree_nodeRef get_field (integer_cst_t offset)
 returns tree_nodeRef of the field specified by offset More...
 
std::string get_maybe_name () const
 returns the name of the struct represented by this node if there is one else returns the string #UNKNOWN# More...
 
void visit (tree_node_visitor *const v) const override
 Redefinition of get_kind_text. More...
 
- Public Member Functions inherited from type_node
 type_node (unsigned int i)
 constructor More...
 
- Public Member Functions inherited from tree_node
 tree_node (unsigned int i)
 Constructor. More...
 
virtual ~tree_node ()=default
 Destructor. More...
 
virtual enum kind get_kind () const =0
 Virtual function returning the type of the actual class. More...
 
virtual std::string get_kind_text () const =0
 Virtual function returning the name of the actual class. More...
 
std::string ToString () const
 Print this node as string in gimple format. More...
 

Data Fields

std::vector< tree_nodeReflist_of_flds
 list_of_flds is a chain of field_decl for the fields of the struct, and var_decl, type_decl and const_decl for record-scope variables, types and enumerators. More...
 
std::vector< tree_nodeReflist_of_fncs
 list_of_fncs is a chain of methods_decl for the fields of the struct. More...
 
tree_nodeRef ptd
 If pointer mem point to type. More...
 
tree_nodeRef cls
 If pointer mem struct type. More...
 
tree_nodeRef bfld
 binf field are information about this type, as a base type for itself. More...
 
tree_nodeRef binf
 type context More...
 
bool spec_flag
 true when a spec is considered More...
 
bool ptrmem_flag
 true when ptrmem obj is considered More...
 
bool struct_flag
 true when a struct is considered More...
 
tree_nodeRef vfld
 FIXME: check the meaning. More...
 
tree_nodeRef tmpl_parms
 tmpl_parms holds template parameters It is a TREE_LIST, his VALU field is a TREE_VEC whose LIST_OF_OP holds template parameters. More...
 
tree_nodeRef tmpl_args
 tmpl_args holds template instantiations It is a TREE_VEC whose LIST_OF_OP holds template instantiations. More...
 
- Data Fields inherited from type_node
TreeVocabularyTokenTypes_TokenEnum qual
 qual is the set of type qualifiers for this type. More...
 
tree_nodeRef name
 name field contains info on the name used in the program for this type.It is either a TYPE_DECL node, for types that are typedefs, or an IDENTIFIER_NODE in the case of structs, unions or enums that are known with a tag, or zero for types that have no special name. More...
 
tree_nodeRef unql
 unql field, in any member of such a chain, points to the start of the chain. More...
 
tree_nodeRef size
 size field contains a tree that is an expression for the size in bits. More...
 
tree_nodeRef scpe
 context/scope of the type object. More...
 
unsigned int algn
 algn field is the alignment necessary for objects of this type. More...
 
bool packed_flag
 Indicated that objects of this type should be laid out in as compact a way as possible. More...
 
bool system_flag
 system flag: it's true when this is a system variable More...
 
bool libbambu_flag
 it is true when this is a declared inside libbambu More...
 
- Data Fields inherited from tree_node
const unsigned int index
 Represent the index read from the raw file and the index-1 of the vector of tree_node associated to the functions vector present in the tree_manager. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from tree_node
static enum kind get_kind (const std::string &name)
 Given a string, return the corresponding kind. More...
 
static std::string GetString (const enum kind k)
 Given a kind, return the corresponding string. More...
 

Detailed Description

struct definition of the record_type tree node.

The tree walker structure of this node is: #(TOK_RECORD_TYPE type_node (vfld)? (TOK_SPEC)? TOK_STRUCT (flds)? (fncs)? (binf)?)

Definition at line 4078 of file tree_node.hpp.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

visitor enum

Enumerator
GETID 
GETID 
GETID 
GETID 
GETID 
GETID 
GETID 
GETID 
GETID 

Definition at line 4182 of file tree_node.hpp.

Constructor & Destructor Documentation

◆ record_type()

record_type::record_type ( unsigned int  i)
inlineexplicit

constructor

Definition at line 4081 of file tree_node.hpp.

Member Function Documentation

◆ add_flds()

void record_type::add_flds ( const tree_nodeRef a)
inline

Add a field_decl to list of flds.

Parameters
ais a NODE_ID.

Definition at line 4142 of file tree_node.hpp.

◆ add_fncs()

void record_type::add_fncs ( const tree_nodeRef a)
inline

Add a methods_decl to list of fncs.

Parameters
ais a NODE_ID.

Definition at line 4151 of file tree_node.hpp.

References GET_KIND, GET_KIND_TEXT, and offset.

◆ get_field()

tree_nodeRef record_type::get_field ( integer_cst_t  offset)

returns tree_nodeRef of the field specified by offset

Parameters
offsetis the offset of the field from the base address of the record_type
Returns
the tree_nodeRef if the offset is valid else null pointer

Definition at line 1158 of file tree_node.cpp.

References GET_NODE, and field_decl::offset().

Here is the call graph for this function:

◆ get_maybe_name()

std::string record_type::get_maybe_name ( ) const

returns the name of the struct represented by this node if there is one else returns the string #UNKNOWN#

Definition at line 1136 of file tree_node.cpp.

References GET_NODE, decl_node::name, and identifier_node::strg.

◆ visit()

void record_type::visit ( tree_node_visitor *const  v) const
overridevirtual

Redefinition of get_kind_text.

Redefinition of get_kind. virtual function used to traverse the tree_node data structure.

Parameters
vis a reference to the tree_node visitor class

Reimplemented from type_node.

Definition at line 1120 of file tree_node.cpp.

References ALL_VISIT, SEQ_VISIT_MEMBER, gimple_predict::visit(), VISIT_MEMBER, and VISIT_SC.

Here is the call graph for this function:

Field Documentation

◆ bfld

tree_nodeRef record_type::bfld

binf field are information about this type, as a base type for itself.

It is a binfo node. (macro TYPE_BINFO)

Definition at line 4109 of file tree_node.hpp.

Referenced by raw_writer::write_when_not_null_point_to().

◆ binf

tree_nodeRef record_type::binf

type context

Definition at line 4112 of file tree_node.hpp.

Referenced by raw_writer::write_when_not_null_point_to().

◆ cls

tree_nodeRef record_type::cls

If pointer mem struct type.

Definition at line 4102 of file tree_node.hpp.

Referenced by raw_writer::write_when_not_null_point_to().

◆ list_of_flds

std::vector<tree_nodeRef> record_type::list_of_flds

list_of_flds is a chain of field_decl for the fields of the struct, and var_decl, type_decl and const_decl for record-scope variables, types and enumerators.

(macro TYPE_FIELDS)

Definition at line 4090 of file tree_node.hpp.

Referenced by raw_writer::write_when_not_null_point_to().

◆ list_of_fncs

std::vector<tree_nodeRef> record_type::list_of_fncs

list_of_fncs is a chain of methods_decl for the fields of the struct.

(macro TYPE_METHODS)

Definition at line 4096 of file tree_node.hpp.

Referenced by raw_writer::write_when_not_null_point_to().

◆ ptd

tree_nodeRef record_type::ptd

If pointer mem point to type.

Definition at line 4099 of file tree_node.hpp.

Referenced by raw_writer::write_when_not_null_point_to().

◆ ptrmem_flag

bool record_type::ptrmem_flag

true when ptrmem obj is considered

Definition at line 4118 of file tree_node.hpp.

Referenced by raw_writer::write_when_not_null_point_to().

◆ spec_flag

bool record_type::spec_flag

true when a spec is considered

Definition at line 4115 of file tree_node.hpp.

Referenced by raw_writer::write_when_not_null_point_to().

◆ struct_flag

bool record_type::struct_flag

true when a struct is considered

Definition at line 4121 of file tree_node.hpp.

Referenced by raw_writer::write_when_not_null_point_to().

◆ tmpl_args

tree_nodeRef record_type::tmpl_args

tmpl_args holds template instantiations It is a TREE_VEC whose LIST_OF_OP holds template instantiations.

The parameter of instantiation "list_of_op[i]" is "list_of_op[i]" hold in tmpl_parms.

Definition at line 4136 of file tree_node.hpp.

Referenced by raw_writer::write_when_not_null_point_to().

◆ tmpl_parms

tree_nodeRef record_type::tmpl_parms

tmpl_parms holds template parameters It is a TREE_LIST, his VALU field is a TREE_VEC whose LIST_OF_OP holds template parameters.

The instantion of parameter "list_of_op[i]" is "list_of_op[i]" hold in tmpl_args.

Definition at line 4130 of file tree_node.hpp.

Referenced by raw_writer::write_when_not_null_point_to().

◆ vfld

tree_nodeRef record_type::vfld

FIXME: check the meaning.

Definition at line 4124 of file tree_node.hpp.

Referenced by raw_writer::write_when_not_null_point_to().


The documentation for this struct was generated from the following files:

Generated on Mon Feb 12 2024 13:04:02 for PandA-2024.02 by doxygen 1.8.13