PandA-2024.02
|
struct definition of the function_decl tree node. More...
#include <tree_node.hpp>
Public Types | |
enum | { GETID =(decl_node) = 0, GETID =(decl_node) = 0, GETID =(decl_node) = 0, GETID =(decl_node) = 0, GETID =(decl_node) = 0, GETID =(decl_node) = 0, GETID =(decl_node) = 0 } |
visitor enum More... | |
Public Types inherited from decl_node | |
enum | { GETID =(srcp) = 0, GETID =(srcp) = 0, GETID =(srcp) = 0, GETID =(srcp) = 0, GETID =(srcp) = 0, GETID =(srcp) = 0, GETID =(srcp) = 0, GETID =(srcp) = 0 } |
visitor enum More... | |
Public Member Functions | |
function_decl (unsigned int i) | |
constructor More... | |
void | add (std::string a) |
Add a string to list of attribute. More... | |
void | AddArg (const tree_nodeRef &a) |
Add a parameter to the list of the paramters. More... | |
bool | is_constructor () |
return true if is a declaration of constructor More... | |
bool | is_destructor () |
Return true if is a declaration of Destructor. More... | |
bool | is_operator () const |
returns true if is a declaration of an operator More... | |
bool | is_public () |
returns true if is a declaration of a public function More... | |
bool | is_private () |
returns true if is a declaration of a private function More... | |
bool | is_protected () |
returns true if is a declaration of a protected function More... | |
bool | is_pipelined () |
returns true if is a declaration of a pipelined function More... | |
void | set_pipelining (bool v) |
bool | is_simple_pipeline () |
void | set_simple_pipeline (bool v) |
int | get_initiation_time () |
void | set_initiation_time (int time) |
void | visit (tree_node_visitor *const v) const override |
Redefinition of get_kind_text. More... | |
Public Member Functions inherited from decl_node | |
decl_node (unsigned int i) | |
Constructor. More... | |
Public Member Functions inherited from srcp | |
srcp () | |
constructor More... | |
virtual | ~srcp () |
Destructor. 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... | |
Public Member Functions inherited from attr | |
virtual | ~attr () |
Destructor. More... | |
void | add (const TreeVocabularyTokenTypes_TokenEnum a) |
Add an attribute to list of attribute. More... | |
bool | is_constructor () const |
Return true if there is TOK_CONSTRUCTOR in the list of attributes. More... | |
bool | is_destructor () const |
Return true if there is TOK_DESTRUCTOR in the list of attributes. More... | |
bool | is_member () const |
Return true if there is TOK_MEMBER in the list of attributes. More... | |
bool | is_call () const |
returns true if there is a TOK_CALL in the list of attributes More... | |
bool | is_new () const |
returns true if there is a TOK_NEW in the list of attributes More... | |
bool | is_public () const |
returns true if there is a TOK_PUBLIC in the list of attributes More... | |
bool | is_private () const |
returns true if there is a TOK_PRIVATE in the list of attributes More... | |
bool | is_protected () const |
returns true if there is a TOK_PROTECTED in the list of attributes More... | |
bool | is_bitfield () const |
returns true if there is a TOK_BITFIELD in the list of attributes More... | |
Data Fields | |
bool | operator_flag |
it is true when the function_decl is an operator More... | |
std::vector< std::string > | list_of_op_names |
store the list of operator names More... | |
bool | fixd_flag |
flags used to know if fixd is set More... | |
bool | virt_flag |
flags used to know if virt is set More... | |
bool | reverse_restrict_flag |
True if parameters are not alias after its invocation. More... | |
bool | writing_memory |
True if function write in memory somehow. More... | |
bool | reading_memory |
True if function read from memory somehow. More... | |
bool | pipeline_enabled |
True if pipelining is enabled for the function. More... | |
bool | simple_pipeline |
True if the pipeline does not contain any unbounded operation. More... | |
int | initiation_time |
Used for pipelined with unbounded operations. More... | |
int | fixd |
Is the result of THUNK_FIXED_OFFSET(t) for this tree node. More... | |
int | virt |
Is the result of tree_low_cst (THUNK_VIRTUAL_OFFSET (t), 0) for this node. More... | |
tree_nodeRef | fn |
fn field is the initial declaration for this function declaration More... | |
std::string | bit_values |
for each bit of the SSA variable tells if it is equal to U,X,0,1 More... | |
RangeRef | range |
Range information about bounds of the function return value (valid for real_type too) 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... | |
std::vector< tree_nodeRef > | list_of_args |
args field holds a chain of parm_decl nodes for the arguments. More... | |
bool | undefined_flag |
undefined_flag means external reference: do not allocate storage, and refer to a definition elsewhere. More... | |
bool | builtin_flag |
flag true when the function is a builtin More... | |
bool | hwcall_flag |
flag true when the function is marked as hwcall More... | |
bool | static_flag |
static_flag is true if function has been defined (macro TREE_STATIC) More... | |
tree_nodeRef | body |
body field is the saved representation of the body of the entire function. More... | |
tree_nodeRef | inline_body |
java inline body More... | |
Data Fields inherited from decl_node | |
tree_nodeRef | name |
name field contains an identifier_node used to represent a name. More... | |
tree_nodeRef | mngl |
mngl field contains the name of the object as the assembler will see it. More... | |
tree_nodeRef | orig |
For any sort of a ..._DECL node, this points to the original (abstract) decl node which this decl is an instance of, or else it is NULL indicating that this decl is not an instance of some other decl. More... | |
tree_nodeRef | type |
type field holds the data type of the object, when relevant. More... | |
tree_nodeRef | scpe |
scope declaration More... | |
tree_nodeRef | attributes |
bool | artificial_flag |
artificial_flag field is used to indicate that this decl_node represents a compiler-generated entity. More... | |
bool | packed_flag |
Indicates this field should be bit-packed. More... | |
bool | operating_system_flag |
operating system flag: it's true when this is a variable of operating system library More... | |
bool | library_system_flag |
library system flag: it's true when this is a variable of a standard library (e.g libmath) More... | |
bool | libbambu_flag |
it is true when this is a declared inside libbambu More... | |
tree_nodeRef | chan |
chan field: the decls in one binding context are chained through this field. More... | |
bool | C_flag |
is true when the declaration has the C attribute More... | |
unsigned int | uid |
The uid. More... | |
Data Fields inherited from srcp | |
std::string | include_name |
include_name is a filename string, this can be the location of a reference, if no definition has been seen. More... | |
unsigned int | line_number |
line_number holds a line number. More... | |
unsigned int | column_number |
column_number holds the column number. 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... | |
Data Fields inherited from attr | |
CustomOrderedSet< TreeVocabularyTokenTypes_TokenEnum > | list_attr |
list of TOKEN, represented as int, associated to the tree_node 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... | |
struct definition of the function_decl tree node.
The tree walker structure of this node is: #(TOK_FUNCTION_DECL decl_node (TOK_C| TOK_OPERATOR (TOK_STRING)*)? attr (args)? (TOK_UNDEFINED)? (TOK_EXTERN | TOK_STATIC) (body)?)
Definition at line 2759 of file tree_node.hpp.
anonymous enum |
visitor enum
Enumerator | |
---|---|
GETID | |
GETID | |
GETID | |
GETID | |
GETID | |
GETID | |
GETID |
Definition at line 2936 of file tree_node.hpp.
|
explicit |
constructor
Definition at line 736 of file tree_node.cpp.
|
inline |
Add a string to list of attribute.
a | is the token number of the token attribute. |
Definition at line 2881 of file tree_node.hpp.
References GET_KIND, and GET_KIND_TEXT.
void function_decl::AddArg | ( | const tree_nodeRef & | a | ) |
Add a parameter to the list of the paramters.
a | is the parameter to be added. |
Definition at line 777 of file tree_node.cpp.
References list_of_args.
int function_decl::get_initiation_time | ( | ) |
Definition at line 831 of file tree_node.cpp.
References initiation_time.
bool function_decl::is_constructor | ( | ) |
return true if is a declaration of constructor
Definition at line 782 of file tree_node.cpp.
References attr::is_constructor().
bool function_decl::is_destructor | ( | ) |
Return true if is a declaration of Destructor.
Definition at line 786 of file tree_node.cpp.
References attr::is_destructor().
bool function_decl::is_operator | ( | ) | const |
returns true if is a declaration of an operator
Definition at line 791 of file tree_node.cpp.
References operator_flag.
bool function_decl::is_pipelined | ( | ) |
returns true if is a declaration of a pipelined function
Definition at line 811 of file tree_node.cpp.
References pipeline_enabled.
bool function_decl::is_private | ( | ) |
returns true if is a declaration of a private function
Definition at line 801 of file tree_node.cpp.
References attr::is_private().
bool function_decl::is_protected | ( | ) |
returns true if is a declaration of a protected function
Definition at line 806 of file tree_node.cpp.
References attr::is_protected().
bool function_decl::is_public | ( | ) |
returns true if is a declaration of a public function
Definition at line 796 of file tree_node.cpp.
References attr::is_public().
bool function_decl::is_simple_pipeline | ( | ) |
Definition at line 821 of file tree_node.cpp.
References simple_pipeline.
void function_decl::set_initiation_time | ( | int | time | ) |
Definition at line 836 of file tree_node.cpp.
References initiation_time.
void function_decl::set_pipelining | ( | bool | v | ) |
Definition at line 816 of file tree_node.cpp.
References pipeline_enabled.
void function_decl::set_simple_pipeline | ( | bool | v | ) |
Definition at line 826 of file tree_node.cpp.
References simple_pipeline.
|
overridevirtual |
Redefinition of get_kind_text.
Redefinition of get_kind. virtual function used to traverse the tree_node data structure.
v | is a reference to the tree_node visitor class |
Reimplemented from attr.
Definition at line 763 of file tree_node.cpp.
References ALL_VISIT, body, fn, inline_body, list_of_args, SEQ_VISIT_MEMBER, tmpl_args, tmpl_parms, VISIT_MEMBER, and VISIT_SC.
Referenced by function_type::visit().
std::string function_decl::bit_values |
for each bit of the SSA variable tells if it is equal to U,X,0,1
Definition at line 2818 of file tree_node.hpp.
tree_nodeRef function_decl::body |
body field is the saved representation of the body of the entire function.
(macro DECL_SAVED_TREE)
Definition at line 2870 of file tree_node.hpp.
Referenced by GimpleWriter::GimpleWriter(), simple_code_motion::Initialize(), dead_code_elimination::InternalExec(), soft_float_cg_ext::InternalExec(), tree_helper::is_a_nop_function_decl(), Bit_Value_opt::optimize(), tree_helper::print_function_name(), soft_float_cg_ext::ssa_lowering(), visit(), and raw_writer::write_when_not_null_point_to().
bool function_decl::builtin_flag |
flag true when the function is a builtin
Definition at line 2853 of file tree_node.hpp.
Referenced by tree_manager::check_for_decl(), tree_helper::GetMangledFunctionName(), tree_helper::print_function_name(), and raw_writer::write_when_not_null_point_to().
int function_decl::fixd |
Is the result of THUNK_FIXED_OFFSET(t) for this tree node.
Definition at line 2809 of file tree_node.hpp.
Referenced by raw_writer::write_when_not_null_point_to().
bool function_decl::fixd_flag |
flags used to know if fixd is set
Definition at line 2771 of file tree_node.hpp.
Referenced by raw_writer::write_when_not_null_point_to().
tree_nodeRef function_decl::fn |
fn field is the initial declaration for this function declaration
Definition at line 2815 of file tree_node.hpp.
Referenced by visit(), and raw_writer::write_when_not_null_point_to().
bool function_decl::hwcall_flag |
flag true when the function is marked as hwcall
Definition at line 2858 of file tree_node.hpp.
Referenced by raw_writer::write_when_not_null_point_to().
int function_decl::initiation_time |
Used for pipelined with unbounded operations.
Definition at line 2792 of file tree_node.hpp.
Referenced by get_initiation_time(), set_initiation_time(), and raw_writer::write_when_not_null_point_to().
tree_nodeRef function_decl::inline_body |
java inline body
Definition at line 2875 of file tree_node.hpp.
Referenced by visit(), and raw_writer::write_when_not_null_point_to().
std::vector<tree_nodeRef> function_decl::list_of_args |
args field holds a chain of parm_decl nodes for the arguments.
(tree-dump.c use the macro DECL_ARGUMENTS)
Definition at line 2841 of file tree_node.hpp.
Referenced by AddArg(), cannot_have_struct_parameters(), GimpleWriter::GimpleWriter(), soft_float_cg_ext::InternalExec(), Bit_Value_opt::optimize(), soft_float_cg_ext::RecursiveExaminate(), soft_float_cg_ext::signature_lowering(), dead_code_eliminationIPA::signature_opt(), visit(), and raw_writer::write_when_not_null_point_to().
std::vector<std::string> function_decl::list_of_op_names |
store the list of operator names
Definition at line 2768 of file tree_node.hpp.
Referenced by raw_writer::write_when_not_null_point_to().
bool function_decl::operator_flag |
it is true when the function_decl is an operator
Definition at line 2765 of file tree_node.hpp.
Referenced by is_operator(), and raw_writer::write_when_not_null_point_to().
bool function_decl::pipeline_enabled |
True if pipelining is enabled for the function.
Definition at line 2786 of file tree_node.hpp.
Referenced by is_pipelined(), set_pipelining(), and raw_writer::write_when_not_null_point_to().
RangeRef function_decl::range |
Range information about bounds of the function return value (valid for real_type too)
Definition at line 2821 of file tree_node.hpp.
bool function_decl::reading_memory |
True if function read from memory somehow.
Definition at line 2783 of file tree_node.hpp.
Referenced by dead_code_elimination::InternalExec(), and raw_writer::write_when_not_null_point_to().
bool function_decl::reverse_restrict_flag |
True if parameters are not alias after its invocation.
Definition at line 2777 of file tree_node.hpp.
Referenced by raw_writer::write_when_not_null_point_to().
bool function_decl::simple_pipeline |
True if the pipeline does not contain any unbounded operation.
Definition at line 2789 of file tree_node.hpp.
Referenced by is_simple_pipeline(), set_simple_pipeline(), and raw_writer::write_when_not_null_point_to().
bool function_decl::static_flag |
static_flag is true if function has been defined (macro TREE_STATIC)
Definition at line 2864 of file tree_node.hpp.
Referenced by tree_manager::check_for_decl(), and raw_writer::write_when_not_null_point_to().
tree_nodeRef function_decl::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 2835 of file tree_node.hpp.
Referenced by visit(), and raw_writer::write_when_not_null_point_to().
tree_nodeRef function_decl::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 instantiation of parameter "list_of_op[i]" is "list_of_op[i]" hold in tmpl_args.
Definition at line 2828 of file tree_node.hpp.
Referenced by visit(), and raw_writer::write_when_not_null_point_to().
bool function_decl::undefined_flag |
undefined_flag means external reference: do not allocate storage, and refer to a definition elsewhere.
(tree-dump.c use the macro DECL_EXTERNAL)
Definition at line 2848 of file tree_node.hpp.
Referenced by dead_code_elimination::InternalExec(), and raw_writer::write_when_not_null_point_to().
int function_decl::virt |
Is the result of tree_low_cst (THUNK_VIRTUAL_OFFSET (t), 0) for this node.
Definition at line 2812 of file tree_node.hpp.
Referenced by raw_writer::write_when_not_null_point_to().
bool function_decl::virt_flag |
flags used to know if virt is set
Definition at line 2774 of file tree_node.hpp.
Referenced by raw_writer::write_when_not_null_point_to().
bool function_decl::writing_memory |
True if function write in memory somehow.
Definition at line 2780 of file tree_node.hpp.
Referenced by dead_code_elimination::InternalExec(), and raw_writer::write_when_not_null_point_to().