PandA-2024.02
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
tree_manipulation Class Reference

This class creates a layer to add nodes and to manipulate the tree_nodes manager. More...

#include <tree_manipulation.hpp>

Collaboration diagram for tree_manipulation:
Collaboration graph
[legend]

Public Member Functions

 tree_manipulation (const tree_managerRef &TreeM, const ParameterConstRef &parameters, const application_managerRef _AppM)
 This is the constructor of the tree_manipulation. More...
 
 tree_manipulation (const tree_managerRef &TreeM, const ParameterConstRef &parameters, bool _reuse, const application_managerRef _AppM)
 
 ~tree_manipulation ()
 This is the destructor of the tree_manipulation. More...
 
tree_nodeRef create_unary_operation (const tree_nodeConstRef &type, const tree_nodeRef &op, const std::string &srcp, enum kind operation_kind) const
 EXPRESSION_TREE_NODES. More...
 
tree_nodeRef create_binary_operation (const tree_nodeConstRef &type, const tree_nodeRef &op0, const tree_nodeRef &op1, const std::string &srcp, enum kind operation_kind) const
 Function used to create a binary expression. More...
 
tree_nodeRef create_ternary_operation (const tree_nodeConstRef &type, const tree_nodeRef &op0, const tree_nodeRef &op1, const tree_nodeRef &op2, const std::string &srcp, enum kind operation_kind) const
 Function used to create a ternary expression. More...
 
tree_nodeRef create_quaternary_operation (const tree_nodeConstRef &type, const tree_nodeRef &op0, const tree_nodeRef &op1, const tree_nodeRef &op2, const tree_nodeRef &op3, const std::string &srcp, enum kind operation_kind) const
 Function used to create a quaternary expression. More...
 
tree_nodeRef create_lut_expr (const tree_nodeConstRef &type, const tree_nodeRef &op0, const tree_nodeRef &op1, const tree_nodeRef &op2, const tree_nodeRef &op3, const tree_nodeRef &op4, const tree_nodeRef &op5, const tree_nodeRef &op6, const tree_nodeRef &op7, const tree_nodeRef &op8, const std::string &srcp) const
 create_lut_expr: function used to create a generic lut_expr operation More...
 
tree_nodeRef create_extract_bit_expr (const tree_nodeRef &op0, const tree_nodeRef &op1, const std::string &srcp) const
 
tree_nodeRef create_identifier_node (const std::string &strg) const
 IDENTIFIER_TREE_NODE. More...
 
tree_nodeRef create_parm_decl (const tree_nodeRef &name, const tree_nodeConstRef &type, const tree_nodeRef &scpe, const tree_nodeConstRef &argt, const tree_nodeRef &smt_ann, const tree_nodeRef &init, const std::string &srcp, int used, bool register_flag=false, bool readonly_flag=false) const
 DECL_NODES. More...
 
tree_nodeRef create_translation_unit_decl () const
 create or find a global scope More...
 
tree_nodeRef create_result_decl (const tree_nodeRef &name, const tree_nodeRef &type, const tree_nodeRef &scpe, const tree_nodeRef &size, const tree_nodeRef &smt_ann, const tree_nodeRef &init, const std::string &srcp, unsigned int algn, bool artificial_flag=false) const
 Function used to create a result_decl. More...
 
tree_nodeRef create_var_decl (const tree_nodeRef &name, const tree_nodeConstRef &type, const tree_nodeRef &scpe, const tree_nodeRef &size, const tree_nodeRef &smt_ann, const tree_nodeRef &init, const std::string &srcp, unsigned int algn, int used, bool artificial_flag=false, int use_tmpl=-1, bool static_static_flag=false, bool extern_flag=false, bool static_flag=false, bool register_flag=false, bool readonly_flag=false, const std::string &bit_values="", bool addr_taken=false, bool addr_not_taken=false) const
 Function used to create a var_decl. More...
 
tree_nodeRef GetVoidType () const
 TYPE_OBJ. More...
 
tree_nodeRef GetBooleanType () const
 Function that creates a boolean type if it is not already present, otherwise it returns the one that is already in the tree manager. More...
 
tree_nodeRef GetSignedIntegerType () const
 Function that creates a integer type if it is not already present, otherwise it returns the one that is already in the tree manager. More...
 
tree_nodeRef GetUnsignedIntegerType () const
 Function that creates a unsigned integer type if it is not already present, otherwise it returns the one that is already in the tree manager. More...
 
tree_nodeRef GetUnsignedLongLongType () const
 Function that creates a long long unsigned int type if it is not already present, otherwise return the existing type. More...
 
tree_nodeRef GetBitsizeType () const
 Function that creates a bit_size type if it is not already present, otherwise it returns the one that is already in the tree manager. More...
 
tree_nodeRef GetSizeType () const
 create a sizetype builtin type in case it has not already been created, otherwise it returns the one found in the tree manager. More...
 
tree_nodeRef GetPointerType (const tree_nodeConstRef &ptd, unsigned long long algn=0) const
 Function that creates a pointer type if it is not already present, otherwise it returns the one that is already in the tree manager. More...
 
tree_nodeRef GetCustomIntegerType (unsigned long long prec, bool unsigned_p) const
 create an integer type starting from a given prec More...
 
tree_nodeRef GetFunctionType (const tree_nodeConstRef &returnType, const std::vector< tree_nodeConstRef > &argsT) const
 Create a function type. More...
 
tree_nodeRef create_ssa_name (const tree_nodeConstRef &var, const tree_nodeConstRef &type, const tree_nodeConstRef &min, const tree_nodeConstRef &max, bool volatile_flag=false, bool virtual_flag=false) const
 MISCELLANEOUS_OBJ_TREE_NODES. More...
 
tree_nodeRef create_phi_node (tree_nodeRef &ssa_res, const std::vector< std::pair< tree_nodeRef, unsigned int >> &list_of_def_edge, unsigned int function_decl_nid, bool virtual_flag=false) const
 GIMPLE_PHI. More...
 
tree_nodeRef create_gimple_modify_stmt (const tree_nodeRef &op0, const tree_nodeRef &op1, unsigned int function_decl_nid, const std::string &srcp) const
 GIMPLE_ASSIGN. More...
 
tree_nodeRef CreateGimpleAssign (const tree_nodeConstRef &type, const tree_nodeConstRef &min, const tree_nodeConstRef &max, const tree_nodeRef &op, unsigned int function_decl_nid, const std::string &srcp) const
 Create gimple assignment. More...
 
tree_nodeRef create_gimple_call (const tree_nodeConstRef &called_function, const std::vector< tree_nodeRef > &args, unsigned int function_decl_nid, const std::string &srcp) const
 GIMPLE_CALL. More...
 
tree_nodeRef create_gimple_cond (const tree_nodeRef &expr, unsigned int function_decl_nid, const std::string &srcp) const
 GIMPLE_COND. More...
 
tree_nodeRef create_gimple_return (const tree_nodeConstRef &type, const tree_nodeConstRef &expr, unsigned int function_decl_nid, const std::string &srcp) const
 GIMPLE_RETURN. More...
 
void create_label (const blocRef &block, unsigned int function_decl_nid) const
 create a label expression in a header of a loop. More...
 
void create_goto (const blocRef &block, unsigned int function_decl_nid, unsigned int label_expr_nid) const
 create a goto expression. More...
 
tree_nodeRef create_function_decl (const std::string &function_name, const tree_nodeRef &scpe, const std::vector< tree_nodeConstRef > &argsT, const tree_nodeConstRef &returnType, const std::string &srcp, bool with_body) const
 create the declaration of a function without its body More...
 
blocRef create_basic_block (std::map< unsigned int, blocRef > &list_of_bloc, std::vector< unsigned int > predecessors, std::vector< unsigned int > successors, std::vector< tree_nodeRef > stmt, unsigned int number, unsigned int true_edge=0, unsigned int false_edge=0, std::vector< tree_nodeRef > phi=std::vector< tree_nodeRef >()) const
 BASIC BLOCK. More...
 
void bb_add_stmts (blocRef &bb, const std::vector< tree_nodeRef > &stmt) const
 Function that adds in basic block bb the statements listed in vector stmt. More...
 
void bb_add_stmt (blocRef &bb, const tree_nodeRef &stmt) const
 Function that adds in basic block bb the statement stmt. More...
 
void bb_add_successors (blocRef &bb, const std::vector< unsigned int > &successors) const
 Function that adds a list of successors in basic block bb. More...
 
void bb_add_successor (blocRef &bb, const unsigned int &successor) const
 Function that adds a successor in basic block bb. More...
 
void bb_add_predecessors (blocRef &bb, const std::vector< unsigned int > &predecessors) const
 Function that adds a list of predecessors in basic block bb. More...
 
void bb_add_predecessor (blocRef &bb, const unsigned int &predecessor) const
 Function that adds a predecessor in basic block bb. More...
 
void bb_remove_successors (blocRef &bb, const std::vector< unsigned int > &successors) const
 Function that removes a list of successors in basic block bb. More...
 
void bb_remove_successor (blocRef &bb, const unsigned int &successor) const
 Function that removes a successor in basic block bb. More...
 
void bb_remove_predecessors (blocRef &bb, const std::vector< unsigned int > &predecessors) const
 Function that removes a list of predecessors in basic block bb. More...
 
void bb_remove_predecessor (blocRef &bb, const unsigned int &predecessor) const
 Function that removes a predecessor in basic block bb. More...
 
void bb_remove_all_predecessors (blocRef &bb) const
 Function that removes all the predecessors of basic block bb. More...
 
void bb_remove_all_successors (blocRef &bb) const
 Function that removes all the successors of basic block bb. More...
 
void bb_set_false_edge (blocRef &bb, const unsigned int &false_edge_index) const
 Function that sets in basic block bb the index of the then basic block in case the last statement is a gimple_cond. More...
 
void bb_set_true_edge (blocRef &bb, const unsigned int &true_edge_index) const
 Function that sets in basic block bb the index of the if basic block in case the last statement is a gimple_cond. More...
 
tree_nodeRef CreateNotExpr (const tree_nodeConstRef &condition, const blocRef &block, unsigned int function_decl_nid) const
 UTILITY. More...
 
tree_nodeRef CreateAndExpr (const tree_nodeConstRef &first_condition, const tree_nodeConstRef &second_condition, const blocRef &block, unsigned int function_decl_nid) const
 Create an or expression. More...
 
tree_nodeRef CreateOrExpr (const tree_nodeConstRef &first_condition, const tree_nodeConstRef &second_condition, const blocRef &block, unsigned int function_decl_nid) const
 Create an or expression. More...
 
tree_nodeRef ExtractCondition (const tree_nodeRef &condition, const blocRef &block, unsigned int function_decl_nid) const
 Extract computation of condition from a gimple_cond. More...
 
tree_nodeRef CreateNopExpr (const tree_nodeConstRef &operand, const tree_nodeConstRef &type, const tree_nodeConstRef &min, const tree_nodeConstRef &max, unsigned int function_decl_nid) const
 Create a nop_expr to perform a conversion. More...
 
tree_nodeRef CreateUnsigned (const tree_nodeConstRef &signed_type) const
 Create an unsigned integer type starting from signed type. More...
 
tree_nodeRef CreateEqExpr (const tree_nodeConstRef &first_operand, const tree_nodeConstRef &second_operand, const blocRef &block, unsigned int function_decl_nid) const
 Create an eq_expr. More...
 
tree_nodeRef CreateCallExpr (const tree_nodeConstRef &called_function, const std::vector< tree_nodeRef > &args, const std::string &srcp) const
 Create a call_expr. More...
 
tree_nodeRef CreateAddrExpr (const tree_nodeConstRef &tn, const std::string &srcp) const
 Create an addr_expr. More...
 
tree_nodeRef CreateGimpleAssignAddrExpr (const tree_nodeConstRef &tn, unsigned int function_decl_nid, const std::string &srcp) const
 Create a gimple_assign with op0 a new ssa_name, and op1 an addr_expr which takes the address of the tree node tn. More...
 
tree_nodeRef CreateVectorBooleanType (const unsigned long long number_of_elements) const
 Create a vector bool type. More...
 
tree_nodeRef CloneFunction (const tree_nodeRef &tn, const std::string &funNameSuffix)
 CloneFunction duplicates a function. More...
 
unsigned int InlineFunctionCall (const tree_nodeRef &call_node, const tree_nodeRef &caller_node)
 Execute function call inlining of given call statement (call graph must be recomputed after inlining) More...
 
bool VersionFunctionCall (const tree_nodeRef &call_node, const tree_nodeRef &caller_node, const std::string &version_suffix)
 Perform function call versioning. More...
 

Private Member Functions

tree_nodeRef CreateIntegerCst (const tree_nodeConstRef &type, integer_cst_t value, const unsigned int integer_cst_nid) const
 CONST_OBJ_TREE_NODES. More...
 

Private Attributes

tree_managerRef TreeM
 Tree Manager. More...
 
const application_managerRef AppM
 Application manager data structure. More...
 
const bool reuse
 True if statements can be reused. More...
 
const ParameterConstRef parameters
 The set of input parameters. More...
 
const int debug_level
 debug level. More...
 

Static Private Attributes

static unsigned int goto_label_unique_id = 0
 store a unique id used during the creation of the label_decl associated with a gimple_goto. More...
 

Detailed Description

This class creates a layer to add nodes and to manipulate the tree_nodes manager.

Definition at line 115 of file tree_manipulation.hpp.

Constructor & Destructor Documentation

◆ tree_manipulation() [1/2]

tree_manipulation::tree_manipulation ( const tree_managerRef TreeM,
const ParameterConstRef parameters,
const application_managerRef  _AppM 
)

This is the constructor of the tree_manipulation.

Constructor.

Parameters
TreeMis the tree manager.
parametersis the set of input parameters

Definition at line 74 of file tree_manipulation.cpp.

◆ tree_manipulation() [2/2]

tree_manipulation::tree_manipulation ( const tree_managerRef TreeM,
const ParameterConstRef parameters,
bool  _reuse,
const application_managerRef  _AppM 
)

Definition at line 84 of file tree_manipulation.cpp.

References ~tree_manipulation().

Here is the call graph for this function:

◆ ~tree_manipulation()

tree_manipulation::~tree_manipulation ( )
default

This is the destructor of the tree_manipulation.

Destructor.

Referenced by tree_manipulation().

Here is the caller graph for this function:

Member Function Documentation

◆ bb_add_predecessor()

void tree_manipulation::bb_add_predecessor ( blocRef &  bb,
const unsigned int &  predecessor 
) const

Function that adds a predecessor in basic block bb.

Add a predecessor in basic block bb.

Parameters
bbis the basic block.
predecessoris the predecessor.

Definition at line 1992 of file tree_manipulation.cpp.

Referenced by bb_add_predecessors().

Here is the caller graph for this function:

◆ bb_add_predecessors()

void tree_manipulation::bb_add_predecessors ( blocRef &  bb,
const std::vector< unsigned int > &  predecessors 
) const

Function that adds a list of predecessors in basic block bb.

Add a list of predecessors in basic block bb.

Parameters
bbis the basic block.
predecessorsis the vector of predecessors.

Definition at line 1983 of file tree_manipulation.cpp.

References bb_add_predecessor().

Here is the call graph for this function:

◆ bb_add_stmt()

void tree_manipulation::bb_add_stmt ( blocRef &  bb,
const tree_nodeRef stmt 
) const

Function that adds in basic block bb the statement stmt.

Add a statement in basic block.

Parameters
bbis the basic block.
stmtis the statement.

Insert the list of statement

Definition at line 1958 of file tree_manipulation.cpp.

References AppM, debug_level, DEBUG_LEVEL_VERY_PEDANTIC, GET_INDEX_CONST_NODE, GET_NODE, PRINT_DBG_MEX, and STR.

Referenced by bb_add_stmts().

Here is the caller graph for this function:

◆ bb_add_stmts()

void tree_manipulation::bb_add_stmts ( blocRef &  bb,
const std::vector< tree_nodeRef > &  stmt 
) const

Function that adds in basic block bb the statements listed in vector stmt.

Add a list of statement in basic block bb.

Parameters
bbis the basic block.
stmtis the vector of statements.

Insert the list of statement

Definition at line 1948 of file tree_manipulation.cpp.

References bb_add_stmt().

Here is the call graph for this function:

◆ bb_add_successor()

void tree_manipulation::bb_add_successor ( blocRef &  bb,
const unsigned int &  successor 
) const

Function that adds a successor in basic block bb.

Add a successor in basic block bb.

Parameters
bbis the basic block.
successoris the successor.

Definition at line 1977 of file tree_manipulation.cpp.

Referenced by bb_add_successors().

Here is the caller graph for this function:

◆ bb_add_successors()

void tree_manipulation::bb_add_successors ( blocRef &  bb,
const std::vector< unsigned int > &  successors 
) const

Function that adds a list of successors in basic block bb.

Add a list of successors in basic block bb.

Parameters
bbis the basic block.
successorsis the vector of successors.

Definition at line 1968 of file tree_manipulation.cpp.

References bb_add_successor().

Here is the call graph for this function:

◆ bb_remove_all_predecessors()

void tree_manipulation::bb_remove_all_predecessors ( blocRef &  bb) const

Function that removes all the predecessors of basic block bb.

Remove all the predecessors from basic block bb.

Parameters
bbis the basic block.

Definition at line 2038 of file tree_manipulation.cpp.

◆ bb_remove_all_successors()

void tree_manipulation::bb_remove_all_successors ( blocRef &  bb) const

Function that removes all the successors of basic block bb.

Remove all the successors from basic block bb.

Parameters
bbis the basic block.

Definition at line 2044 of file tree_manipulation.cpp.

◆ bb_remove_predecessor()

void tree_manipulation::bb_remove_predecessor ( blocRef &  bb,
const unsigned int &  predecessor 
) const

Function that removes a predecessor in basic block bb.

Remove a predecessors in basic block bb.

Parameters
bbis the basic block.
predecessoris the predecessor.

Definition at line 2027 of file tree_manipulation.cpp.

References debug_level, DEBUG_LEVEL_VERY_PEDANTIC, PRINT_DBG_MEX, STR, and THROW_ASSERT.

Referenced by bb_remove_predecessors().

Here is the caller graph for this function:

◆ bb_remove_predecessors()

void tree_manipulation::bb_remove_predecessors ( blocRef &  bb,
const std::vector< unsigned int > &  predecessors 
) const

Function that removes a list of predecessors in basic block bb.

Remove a list of predecessors in basic block bb.

Parameters
bbis the basic block.
predecessorsis the vector of predecessors.

Definition at line 2018 of file tree_manipulation.cpp.

References bb_remove_predecessor().

Here is the call graph for this function:

◆ bb_remove_successor()

void tree_manipulation::bb_remove_successor ( blocRef &  bb,
const unsigned int &  successor 
) const

Function that removes a successor in basic block bb.

Remove a successor from basic block bb.

Parameters
bbis the basic block.
successoris the successor.

Definition at line 2007 of file tree_manipulation.cpp.

References debug_level, DEBUG_LEVEL_VERY_PEDANTIC, PRINT_DBG_MEX, STR, and THROW_ASSERT.

Referenced by bb_remove_successors().

Here is the caller graph for this function:

◆ bb_remove_successors()

void tree_manipulation::bb_remove_successors ( blocRef &  bb,
const std::vector< unsigned int > &  successors 
) const

Function that removes a list of successors in basic block bb.

Remove a list of successors from basic block bb.

Parameters
bbis the basic block.
successorsis the vector of successors.

Definition at line 1998 of file tree_manipulation.cpp.

References bb_remove_successor().

Here is the call graph for this function:

◆ bb_set_false_edge()

void tree_manipulation::bb_set_false_edge ( blocRef &  bb,
const unsigned int &  false_edge_index 
) const

Function that sets in basic block bb the index of the then basic block in case the last statement is a gimple_cond.

Set the false edge of basic block bb.

Parameters
bbis the basic block.
false_edge_indexis the index of the then basic block.

Definition at line 2050 of file tree_manipulation.cpp.

◆ bb_set_true_edge()

void tree_manipulation::bb_set_true_edge ( blocRef &  bb,
const unsigned int &  true_edge_index 
) const

Function that sets in basic block bb the index of the if basic block in case the last statement is a gimple_cond.

Set the true edge of basic block bb.

Parameters
bbis the basic block.
true_edge_indexis the index of the if basic block.

Definition at line 2056 of file tree_manipulation.cpp.

◆ CloneFunction()

tree_nodeRef tree_manipulation::CloneFunction ( const tree_nodeRef tn,
const std::string &  funNameSuffix 
)

CloneFunction duplicates a function.

Parameters
tnis the tree reindex of the function decl
funNameSuffixis the suffix added to function_decl newly created
Returns
tree_reindex of the new function decl

Definition at line 2781 of file tree_manipulation.cpp.

References AppM, create_identifier_node(), tree_node_dup::create_tree_node(), FUNCTION, GET_CONST_NODE, GET_INDEX_CONST_NODE, tree_node::get_kind(), GET_NODE, tree_manager::GetFunction(), tree_helper::GetMangledFunctionName(), tree_manager::GetTreeReindex(), tree_helper::print_function_name(), THROW_ASSERT, and TreeM.

Referenced by soft_float_cg_ext::generate_interface(), soft_float_cg_ext::replaceWithCall(), and VersionFunctionCall().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_basic_block()

blocRef tree_manipulation::create_basic_block ( std::map< unsigned int, blocRef > &  list_of_bloc,
std::vector< unsigned int >  predecessors,
std::vector< unsigned int >  successors,
std::vector< tree_nodeRef stmt,
unsigned int  number,
unsigned int  true_edge = 0,
unsigned int  false_edge = 0,
std::vector< tree_nodeRef phi = std::vector<tree_nodeRef>() 
) const

BASIC BLOCK.

BASIC_BLOCK.

Function used to create a new basic block.

Parameters
list_of_blocis the list of basic blocks.
predecessorsis the list of predecessors of the basic block to be created (indexes of the blocks).
successorsis the list of successors of the basic block to be created (indexes of the blocks).
stmtis the list of the stmt node to be inserted in the basic block (tree_reindex nodes).
numberis the new basic block number
true_edgeis the index of the basic block it goes if there is a jump expression and the condition is satisfied (default=0).
false_edgeis the index of the basic block it goes if there is a jump expression and the condition is not satisfied (default=0).
phiis the list of the gimple_phi to be inserted (default empty).
Returns
basic block created.

Create a basic block

Create new basic block

Set the true_edge

Set the false_edge

Insert the list of predecessors

Insert the list of successors

Insert the list of statement

Insert the list of phi node

Definition at line 1895 of file tree_manipulation.cpp.

References AppM, debug_level, DEBUG_LEVEL_VERY_PEDANTIC, GET_INDEX_CONST_NODE, GET_NODE, PRINT_DBG_MEX, and STR.

◆ create_binary_operation()

tree_nodeRef tree_manipulation::create_binary_operation ( const tree_nodeConstRef type,
const tree_nodeRef op0,
const tree_nodeRef op1,
const std::string &  srcp,
enum kind  operation_kind 
) const

Function used to create a binary expression.

TODO weight_node to fix in tree_node_factory.cpp Create a binary expression.

Parameters
typeis the type of the expression (tree_reindex).
op0is the first operand of the binary expression (tree_reindex).
op1is the second operand of the binary expression (tree_reindex).
srcpis the definition of the source position.
operation_kindis the kind of binary expression to create (bit_and_expr_K, plus_expr_K,...).
Returns
the tree_reindex node of the operation created.

Check if the tree_node given are tree_reindex

Check if the tree_node type is a binary expression

Check if it is a correct node type

Definition at line 226 of file tree_manipulation.cpp.

References CASE_BINARY_EXPRESSION, CASE_CPP_NODES, CASE_CST_NODES, CASE_DECL_NODES, CASE_FAKE_NODES, CASE_GIMPLE_NODES, CASE_PRAGMA_NODES, CASE_QUATERNARY_EXPRESSION, CASE_TERNARY_EXPRESSION, CASE_TYPE_NODES, CASE_UNARY_EXPRESSION, tree_helper::CGetElements(), tree_manager::create_tree_node(), debug_level, DEBUG_LEVEL_VERY_PEDANTIC, GET_CONST_NODE, GET_INDEX_CONST_NODE, tree_node::get_kind(), GET_NODE, tree_manager::GetTreeReindex(), tree_helper::IsBooleanType(), tree_helper::IsVectorType(), tree_manager::new_tree_node_id(), PRINT_DBG_MEX, STR, THROW_ASSERT, THROW_ERROR, TOK, TOK_OP0, TOK_OP1, TOK_SRCP, TOK_TYPE, and TreeM.

Referenced by IR_lowering::array_ref_lowering(), IR_lowering::division_by_a_constant(), IR_lowering::expand_MC(), IR_lowering::expand_mult_const(), IR_lowering::expand_mult_highpart(), IR_lowering::expand_sdiv_pow2(), IR_lowering::expand_smod_pow2(), IR_lowering::expand_target_mem_ref(), ExtractCondition(), soft_float_cg_ext::floatAbs(), soft_float_cg_ext::floatNegate(), commutative_expr_restructuring::InternalExec(), IR_lowering::InternalExec(), Bit_Value_opt::optimize(), InterfaceInfer::setReadInterface(), and InterfaceInfer::setWriteInterface().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_extract_bit_expr()

tree_nodeRef tree_manipulation::create_extract_bit_expr ( const tree_nodeRef op0,
const tree_nodeRef op1,
const std::string &  srcp 
) const

◆ create_function_decl()

tree_nodeRef tree_manipulation::create_function_decl ( const std::string &  function_name,
const tree_nodeRef scpe,
const std::vector< tree_nodeConstRef > &  argsT,
const tree_nodeConstRef returnType,
const std::string &  srcp,
bool  with_body 
) const

create the declaration of a function without its body

Parameters
function_nameis the function name
scpeis the function scope
argsTis the vector of argument types
returnTypeis the return type
srcpis the source references
with_bodywhen true a stub of the body is created
Returns
is the the tree_reindex associated with the function_decl created.

add parm_decl to the function_decl

Definition at line 2273 of file tree_manipulation.cpp.

References tree_manager::add_function(), create_identifier_node(), create_parm_decl(), tree_manager::create_tree_node(), tree_manager::find(), GET_INDEX_CONST_NODE, tree_manager::get_next_available_tree_node_id(), GET_NODE, tree_manager::GetFunction(), GetFunctionType(), tree_manager::GetTreeReindex(), tree_manager::new_tree_node_id(), STR, THROW_ERROR, TOK, TOK_BODY, TOK_NAME, TOK_SCPE, TOK_SRCP, TOK_STRG, TOK_TYPE, and TreeM.

Referenced by InterfaceInfer::Exec(), InterfaceInfer::setReadInterface(), and InterfaceInfer::setWriteInterface().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_gimple_call()

tree_nodeRef tree_manipulation::create_gimple_call ( const tree_nodeConstRef called_function,
const std::vector< tree_nodeRef > &  args,
unsigned int  function_decl_nid,
const std::string &  srcp 
) const

◆ create_gimple_cond()

tree_nodeRef tree_manipulation::create_gimple_cond ( const tree_nodeRef expr,
unsigned int  function_decl_nid,
const std::string &  srcp 
) const

GIMPLE_COND.

Function used to create a new gimple_cond with only one operand and of void type.

Parameters
expris the condition and can be of any type.
srcpis the definition of the source position.
Returns
the tree_reindex node of the gimple_cond created.
the tree_reindex node of the gimple_cond created.

Create a gimple_cond with one operand (type void)

schema used to create the nodes

@116 gimple_cond type: @62 srcp: "array.c":1 op: @115

Definition at line 1766 of file tree_manipulation.cpp.

References tree_helper::CGetType(), tree_manager::create_tree_node(), debug_level, DEBUG_LEVEL_VERY_PEDANTIC, GET_INDEX_CONST_NODE, tree_node::get_kind(), GET_NODE, tree_manager::GetTreeReindex(), GetVoidType(), tree_helper::IsBooleanType(), tree_manager::new_tree_node_id(), PRINT_DBG_MEX, STR, THROW_ASSERT, TOK, TOK_OP0, TOK_SCPE, TOK_SRCP, TOK_TYPE, and TreeM.

Referenced by SerializeMutualExclusions::InternalExec().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_gimple_modify_stmt()

tree_nodeRef tree_manipulation::create_gimple_modify_stmt ( const tree_nodeRef op0,
const tree_nodeRef op1,
unsigned int  function_decl_nid,
const std::string &  srcp 
) const

◆ create_gimple_return()

tree_nodeRef tree_manipulation::create_gimple_return ( const tree_nodeConstRef type,
const tree_nodeConstRef expr,
unsigned int  function_decl_nid,
const std::string &  srcp 
) const

GIMPLE_RETURN.

Create gimple_return.

Function used to create a new gimple_return.

Parameters
typeis the type of the expression returned.
expris the value to return.
srcpis the definition of the source position.
Returns
the tree_reindex node of the gimple_return created.

Add definition in ssa_name

Definition at line 1796 of file tree_manipulation.cpp.

References tree_manager::create_tree_node(), debug_level, DEBUG_LEVEL_VERY_PEDANTIC, GET_INDEX_CONST_NODE, tree_node::get_kind(), GET_NODE, tree_manager::GetTreeReindex(), GetVoidType(), tree_manager::new_tree_node_id(), PRINT_DBG_MEX, STR, THROW_ASSERT, TOK, TOK_OP, TOK_SCPE, TOK_SRCP, TOK_TYPE, and TreeM.

Here is the call graph for this function:

◆ create_goto()

void tree_manipulation::create_goto ( const blocRef &  block,
unsigned int  function_decl_nid,
unsigned int  label_expr_nid 
) const

create a goto expression.

Parameters
blockis the basic block where the goto expression has to be inserted.
function_decl_nidis the node id of the function where the goto expression is defined.
label_expr_nidis the node id of the label expression associated with the goto expression.

compute the label_decl_nid

create the gimple_goto tree node

Definition at line 2192 of file tree_manipulation.cpp.

References tree_manager::add_goto(), AppM, BUILTIN_SRCP, tree_manager::create_tree_node(), tree_manager::find(), GET_INDEX_CONST_NODE, GET_NODE, tree_manager::get_tree_node_const(), tree_manager::GetTreeReindex(), tree_manager::new_tree_node_id(), STR, THROW_ASSERT, TOK, TOK_ALGN, TOK_NAME, TOK_OP, TOK_SCPE, TOK_SRCP, TOK_STRG, TOK_TYPE, and TreeM.

Here is the call graph for this function:

◆ create_identifier_node()

tree_nodeRef tree_manipulation::create_identifier_node ( const std::string &  strg) const

IDENTIFIER_TREE_NODE.

Function used to create an identifier node if it is not already present, otherwise it returns the one that is already in the tree manager.

Parameters
strgis the identifier string associated with the identifier_node.
Returns
the tree_reindex node of the identifier_node created.

Create an identifier node

@37 identifier_node strg: "int" lngt: 3

Definition at line 746 of file tree_manipulation.cpp.

References tree_manager::create_tree_node(), debug_level, DEBUG_LEVEL_VERY_PEDANTIC, tree_manager::find(), GET_INDEX_CONST_NODE, GET_NODE, tree_manager::GetTreeReindex(), tree_manager::new_tree_node_id(), PRINT_DBG_MEX, STR, THROW_ASSERT, TOK, TOK_STRG, and TreeM.

Referenced by CloneFunction(), create_function_decl(), InterfaceInfer::Exec(), GetBitsizeType(), GetBooleanType(), GetSignedIntegerType(), GetSizeType(), GetUnsignedIntegerType(), GetUnsignedLongLongType(), and GetVoidType().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_label()

void tree_manipulation::create_label ( const blocRef &  block,
unsigned int  function_decl_nid 
) const

create a label expression in a header of a loop.

Parameters
blockis the basic block where the label expression has to be inserted.
function_decl_nidis the node id of the function where the label expression is defined.

check if the first statement is a gimple_label but with a unnamed label_decl.

addd the name to the label_decl

Definition at line 2061 of file tree_manipulation.cpp.

References AppM, BUILTIN_SRCP, tree_manager::create_tree_node(), tree_manager::find(), GET_INDEX_CONST_NODE, GET_NODE, tree_manager::get_tree_node_const(), tree_manager::GetTreeReindex(), goto_label_unique_id, tree_manager::new_tree_node_id(), STR, THROW_ASSERT, TOK, TOK_ALGN, TOK_NAME, TOK_OP, TOK_SCPE, TOK_SRCP, TOK_STRG, TOK_TYPE, and TreeM.

Here is the call graph for this function:

◆ create_lut_expr()

tree_nodeRef tree_manipulation::create_lut_expr ( const tree_nodeConstRef type,
const tree_nodeRef op0,
const tree_nodeRef op1,
const tree_nodeRef op2,
const tree_nodeRef op3,
const tree_nodeRef op4,
const tree_nodeRef op5,
const tree_nodeRef op6,
const tree_nodeRef op7,
const tree_nodeRef op8,
const std::string &  srcp 
) const

create_lut_expr: function used to create a generic lut_expr operation

Parameters
typeis the type of the expression (tree_reindex).
op0describes the LUT functionality as a constant integer.
op1is the first operand of the lut_expr expression (tree_reindex).
op2is the second operand of the lut_expr expression (tree_reindex).
op3is the third operand of the lut_expr expression (tree_reindex).
op4is the fourth operand of the lut_expr expression (tree_reindex).
op5is the fifth operand of the lut_expr expression (tree_reindex).
op6is the sixth operand of the lut_expr expression (tree_reindex).
op7is the seventh operand of the lut_expr expression (tree_reindex).
op8is the eighth operand of the lut_expr expression (tree_reindex).
srcpis the definition of the source position.
Returns
the tree_reindex node of the operation created.

Definition at line 635 of file tree_manipulation.cpp.

References tree_manager::create_tree_node(), debug_level, DEBUG_LEVEL_VERY_PEDANTIC, GET_INDEX_CONST_NODE, tree_node::get_kind(), GET_NODE, tree_manager::GetTreeReindex(), tree_manager::new_tree_node_id(), PRINT_DBG_MEX, STR, THROW_ASSERT, TOK, TOK_OP0, TOK_OP1, TOK_OP2, TOK_OP3, TOK_OP4, TOK_OP5, TOK_OP6, TOK_OP7, TOK_OP8, TOK_SRCP, TOK_TYPE, and TreeM.

Referenced by Bit_Value_opt::optimize(), and lut_transformation::ProcessBasicBlock().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_parm_decl()

tree_nodeRef tree_manipulation::create_parm_decl ( const tree_nodeRef name,
const tree_nodeConstRef type,
const tree_nodeRef scpe,
const tree_nodeConstRef argt,
const tree_nodeRef smt_ann,
const tree_nodeRef init,
const std::string &  srcp,
int  used,
bool  register_flag = false,
bool  readonly_flag = false 
) const

DECL_NODES.

Create parm_decl.

Function used to create a parm_decl.

Parameters
nameis the name field containing an identifier_node used to represent a name.
typeis the type.
scpeis the scope declaration.
sizeis the size field holding the size of datum, in bits.
argtis the type in which the argument is actually passed.
smt_annis the symbol_memory_tag annotation.
initis the init field holding the value to initialize a variable to.
srcpis the definition of the source position.
usedis nonzero if the name is used in its scope
register_flagmeans declared 'register'
readonly_flagmeans declared 'readonly'
Returns
the tree_reindex node of the parm_decl created.

Check if the tree_node given are tree_reindex

Definition at line 934 of file tree_manipulation.cpp.

References tree_manager::create_tree_node(), debug_level, DEBUG_LEVEL_VERY_PEDANTIC, GET_CONST_NODE, GET_INDEX_CONST_NODE, tree_node::get_kind(), tree_manager::GetTreeReindex(), tree_manager::new_tree_node_id(), PRINT_DBG_MEX, STR, THROW_ASSERT, TOK, TOK_ALGN, TOK_ARGT, TOK_INIT, TOK_NAME, TOK_READONLY, TOK_REGISTER, TOK_SCPE, TOK_SIZE, TOK_SMT_ANN, TOK_SRCP, TOK_TYPE, TOK_USED, and TreeM.

Referenced by create_function_decl().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_phi_node()

tree_nodeRef tree_manipulation::create_phi_node ( tree_nodeRef ssa_res,
const std::vector< std::pair< tree_nodeRef, unsigned int >> &  list_of_def_edge,
unsigned int  function_decl_nid,
bool  virtual_flag = false 
) const

GIMPLE_PHI.

Function used to create a gimple_phi.

Parameters
ssa_resis the new ssa_name node created by the phi node.
list_of_def_edgevector where each tuple contains the incoming reaching definition (ssa_name node) and the edge via which that definition is coming through.
virtual_flagflag to set if it is a virtual gimple_phi (default false).
Returns
the tree_reindex node of the gimple_phi.

Create a gimple_phi

Definition at line 1833 of file tree_manipulation.cpp.

References BUILTIN_SRCP, tree_helper::CGetType(), create_ssa_name(), tree_manager::create_tree_node(), debug_level, DEBUG_LEVEL_VERY_PEDANTIC, GET_INDEX_CONST_NODE, tree_node::get_kind(), GET_NODE, tree_manager::GetTreeReindex(), tree_manager::new_tree_node_id(), PRINT_DBG_MEX, tree_helper::Size(), STR, THROW_ASSERT, TOK, TOK_RES, TOK_SCPE, TOK_SRCP, and TreeM.

Referenced by InlineFunctionCall(), MultipleEntryIfReduction::InternalExec(), and materializeStack().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_quaternary_operation()

tree_nodeRef tree_manipulation::create_quaternary_operation ( const tree_nodeConstRef type,
const tree_nodeRef op0,
const tree_nodeRef op1,
const tree_nodeRef op2,
const tree_nodeRef op3,
const std::string &  srcp,
enum kind  operation_kind 
) const

Function used to create a quaternary expression.

TODO weight_node to fix in tree_node_factory.cpp Create a quaternary expression.

Parameters
typeis the type of the expression (tree_reindex).
op0is the first operand of the quaternary expression (tree_reindex).
op1is the second operand of the quaternary expression (tree_reindex).
op2is the third operand of the quaternary expression (tree_reindex).
op3is the fourth operand of the quaternary expression (tree_reindex).
srcpis the definition of the source position.
operation_kindis the kind of quaternary expression to create (array_range_ref_K, array_ref_K).
Returns
the tree_reindex node of the operation created.

Check if the tree_node given are tree_reindex

Check if the tree_node type is a quaternary expression

Definition at line 506 of file tree_manipulation.cpp.

References CASE_BINARY_EXPRESSION, CASE_CPP_NODES, CASE_CST_NODES, CASE_DECL_NODES, CASE_FAKE_NODES, CASE_GIMPLE_NODES, CASE_PRAGMA_NODES, CASE_QUATERNARY_EXPRESSION, CASE_TERNARY_EXPRESSION, CASE_TYPE_NODES, CASE_UNARY_EXPRESSION, tree_manager::create_tree_node(), debug_level, DEBUG_LEVEL_VERY_PEDANTIC, GET_CONST_NODE, GET_INDEX_CONST_NODE, tree_node::get_kind(), GET_NODE, tree_manager::GetTreeReindex(), tree_manager::new_tree_node_id(), PRINT_DBG_MEX, STR, THROW_ASSERT, THROW_ERROR, TOK, TOK_OP0, TOK_OP1, TOK_OP2, TOK_OP3, TOK_SRCP, TOK_TYPE, and TreeM.

Here is the call graph for this function:

◆ create_result_decl()

tree_nodeRef tree_manipulation::create_result_decl ( const tree_nodeRef name,
const tree_nodeRef type,
const tree_nodeRef scpe,
const tree_nodeRef size,
const tree_nodeRef smt_ann,
const tree_nodeRef init,
const std::string &  srcp,
unsigned int  algn,
bool  artificial_flag = false 
) const

Function used to create a result_decl.

Create result_decl.

Parameters
nameis the name field containing an identifier_node used to represent a name.
typeis the type.
scpeis the scope declaration.
sizeis the size field holding the size of datum, in bits.
smt_annis the symbol_memory_tag annotation (default empty).
initis the init field holding the value to initialize a variable to.
srcpis the definition of the source position.
algnis the field holding the alignment required for the datum, in bits.
artificial_flagused to indicate that this decl_node represents a compiler-generated entity (default false).
Returns
the tree_reindex node of the result_decl created.

Check if the tree_node given are tree_reindex

Definition at line 874 of file tree_manipulation.cpp.

References tree_manager::create_tree_node(), debug_level, DEBUG_LEVEL_VERY_PEDANTIC, GET_INDEX_CONST_NODE, tree_node::get_kind(), GET_NODE, tree_manager::GetTreeReindex(), tree_manager::new_tree_node_id(), PRINT_DBG_MEX, STR, THROW_ASSERT, TOK, TOK_ALGN, TOK_ARTIFICIAL, TOK_INIT, TOK_NAME, TOK_SCPE, TOK_SIZE, TOK_SMT_ANN, TOK_SRCP, TOK_TYPE, and TreeM.

Here is the call graph for this function:

◆ create_ssa_name()

tree_nodeRef tree_manipulation::create_ssa_name ( const tree_nodeConstRef var,
const tree_nodeConstRef type,
const tree_nodeConstRef min,
const tree_nodeConstRef max,
bool  volatile_flag = false,
bool  virtual_flag = false 
) const

MISCELLANEOUS_OBJ_TREE_NODES.

SSA_NAME Function used to create a ssa_name node.

Parameters
varis the variable being referenced.
typeis the type of the ssa_node
minis the minimum value of the ssa_var
maxis the maximum value of the ssa_var
volatile_flagflag set to true in case a ssa_name is never defined (default false).
virtual_flagflag for virtual phi (default false).
Returns
the tree_reindex node of the ssa_name.

SSA_NAME Create a ssa_name node

Definition at line 1608 of file tree_manipulation.cpp.

References tree_manager::create_tree_node(), debug_level, DEBUG_LEVEL_VERY_PEDANTIC, GET_CONST_NODE, GET_INDEX_CONST_NODE, tree_node::get_kind(), tree_manager::get_next_vers(), GET_NODE, tree_manager::GetTreeReindex(), INDENT_DBG_MEX, tree_node::index, tree_manager::new_tree_node_id(), STR, THROW_ASSERT, TOK, TOK_MAX, TOK_MIN, TOK_SCPE, TOK_SRCP, TOK_TYPE, TOK_VAR, TOK_VERS, TOK_VIRTUAL, TOK_VOLATILE, tree_node::ToString(), and TreeM.

Referenced by PhiOpt::ApplyIfMerge(), PhiOpt::ApplyMultiMerge(), create_phi_node(), CreateGimpleAssign(), Vectorize::DuplicateIncrement(), Vectorize::FixPhis(), parm2ssa::InternalExec(), commutative_expr_restructuring::InternalExec(), MultipleEntryIfReduction::InternalExec(), Bit_Value_opt::optimize(), InterfaceInfer::setReadInterface(), InterfaceInfer::setWriteInterface(), and virtual_phi_nodes_split::virtual_split_phi().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_ternary_operation()

tree_nodeRef tree_manipulation::create_ternary_operation ( const tree_nodeConstRef type,
const tree_nodeRef op0,
const tree_nodeRef op1,
const tree_nodeRef op2,
const std::string &  srcp,
enum kind  operation_kind 
) const

Function used to create a ternary expression.

TODO weight_node to fix in tree_node_factory.cpp Create a ternary expression.

Parameters
typeis the type of the expression (tree_reindex).
op0is the first operand of the ternary expression (tree_reindex).
op1is the second operand of the ternary expression (tree_reindex).
op2is the third operand of the ternary expression (tree_reindex).
srcpis the definition of the source position.
operation_kindis the kind of ternary expression to create (component_ref_K, gimple_switch_K,...).
Returns
the tree_reindex node of the operation created.

Check if the tree_node given are tree_reindex

Check if the tree_node type is a ternary expression

Check if it is a correct node type

some checks

Definition at line 363 of file tree_manipulation.cpp.

References CASE_BINARY_EXPRESSION, CASE_CPP_NODES, CASE_CST_NODES, CASE_DECL_NODES, CASE_FAKE_NODES, CASE_GIMPLE_NODES, CASE_PRAGMA_NODES, CASE_QUATERNARY_EXPRESSION, CASE_TERNARY_EXPRESSION, CASE_TYPE_NODES, CASE_UNARY_EXPRESSION, tree_helper::CGetType(), tree_manager::create_tree_node(), debug_level, DEBUG_LEVEL_VERY_PEDANTIC, GET_CONST_NODE, GET_INDEX_CONST_NODE, tree_node::get_kind(), GET_NODE, tree_manager::GetTreeReindex(), tree_manager::new_tree_node_id(), PRINT_DBG_MEX, tree_helper::Size(), STR, THROW_ASSERT, THROW_ERROR, TOK, TOK_OP0, TOK_OP1, TOK_OP2, TOK_SRCP, TOK_TYPE, ToString(), and TreeM.

Referenced by PhiOpt::ApplyIfMerge(), PhiOpt::ApplyIfRemove(), PhiOpt::ApplyMultiMerge(), PhiOpt::ApplyMultiRemove(), IR_lowering::expand_sdiv_pow2(), IR_lowering::expand_smod_pow2(), Vectorize::FixPhis(), PhiOpt::IdentifyPattern(), extract_patterns::InternalExec(), Bit_Value_opt::optimize(), and Vectorize::Transform().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_translation_unit_decl()

tree_nodeRef tree_manipulation::create_translation_unit_decl ( ) const

◆ create_unary_operation()

tree_nodeRef tree_manipulation::create_unary_operation ( const tree_nodeConstRef type,
const tree_nodeRef op,
const std::string &  srcp,
enum kind  operation_kind 
) const

EXPRESSION_TREE_NODES.

Function used to create an unary expression.

Parameters
typeis the type of the expression (tree_reindex).
opis the operand of the unary expression (tree_reindex).
srcpis the definition of the source position.
operation_kindis the kind of unary expression to create (bit_not_expr_K, nop_expr_K,...).
Returns
the tree_reindex node of the operation created.

TODO weight_node to fix in tree_node_factory.cpp Create an unary operation

Check if the tree_node given are tree_reindex

Check if the tree_node type is a unary expression

Check if it is a correct node type

Definition at line 101 of file tree_manipulation.cpp.

References CASE_BINARY_EXPRESSION, CASE_CPP_NODES, CASE_CST_NODES, CASE_DECL_NODES, CASE_FAKE_NODES, CASE_GIMPLE_NODES, CASE_PRAGMA_NODES, CASE_QUATERNARY_EXPRESSION, CASE_TERNARY_EXPRESSION, CASE_TYPE_NODES, CASE_UNARY_EXPRESSION, tree_manager::create_tree_node(), debug_level, DEBUG_LEVEL_VERY_PEDANTIC, GET_CONST_NODE, GET_INDEX_CONST_NODE, tree_node::get_kind(), GET_NODE, tree_manager::GetTreeReindex(), tree_manager::new_tree_node_id(), PRINT_DBG_MEX, STR, THROW_ASSERT, THROW_ERROR, TOK, TOK_OP, TOK_SRCP, TOK_TYPE, and TreeM.

Referenced by IR_lowering::array_ref_lowering(), IR_lowering::division_by_a_constant(), IR_lowering::expand_MC(), IR_lowering::expand_mult_const(), IR_lowering::expand_target_mem_ref(), IR_lowering::InternalExec(), soft_float_cg_ext::InternalExec(), Bit_Value_opt::optimize(), FunctionCallTypeCleanup::ParametersTypeCleanup(), lut_transformation::ProcessBasicBlock(), soft_float_cg_ext::RecursiveExaminate(), InterfaceInfer::setReadInterface(), InterfaceInfer::setWriteInterface(), and soft_float_cg_ext::ssa_lowering().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_var_decl()

tree_nodeRef tree_manipulation::create_var_decl ( const tree_nodeRef name,
const tree_nodeConstRef type,
const tree_nodeRef scpe,
const tree_nodeRef size,
const tree_nodeRef smt_ann,
const tree_nodeRef init,
const std::string &  srcp,
unsigned int  algn,
int  used,
bool  artificial_flag = false,
int  use_tmpl = -1,
bool  static_static_flag = false,
bool  extern_flag = false,
bool  static_flag = false,
bool  register_flag = false,
bool  readonly_flag = false,
const std::string &  bit_values = "",
bool  addr_taken = false,
bool  addr_not_taken = false 
) const

Function used to create a var_decl.

DECL_NODES.

Parameters
nameis the name field containing an identifier_node used to represent a name.
typeis the type.
scpeis the scope declaration.
sizeis the size field holding the size of datum, in bits.
smt_annis the symbol_memory_tag annotation.
initis the init field holding the value to initialize a variable to.
srcpis the definition of the source position.
algnis the field holding the alignment required for the datum, in bits.
usedis nonzero if the name is used in its scope
artificial_flagused to indicate that this decl_node represents a compiler-generated entity (default false).
use_tmplindicates whether or not (and how) a template was expanded for this VAR_DECL (default -1).
static_static_flagto manage C++ code with static member (default false).
static_flagto manage standard static attribute (default false).
extern_flaga variable can be extern (default false).
initfield holds the value to initialize a variable to (default false).
Returns
the tree_reindex node of the var_decl created.

Create a var_decl

Check if the tree_node given are tree_reindex

Definition at line 779 of file tree_manipulation.cpp.

References tree_manager::create_tree_node(), debug_level, DEBUG_LEVEL_VERY_PEDANTIC, GET_INDEX_CONST_NODE, tree_node::get_kind(), GET_NODE, tree_manager::GetTreeReindex(), tree_manager::new_tree_node_id(), PRINT_DBG_MEX, STR, THROW_ASSERT, TOK, TOK_ADDR_NOT_TAKEN, TOK_ADDR_TAKEN, TOK_ALGN, TOK_ARTIFICIAL, TOK_BIT_VALUES, TOK_EXTERN, TOK_INIT, TOK_NAME, TOK_READONLY, TOK_REGISTER, TOK_SCPE, TOK_SIZE, TOK_SMT_ANN, TOK_SRCP, TOK_STATIC, TOK_STATIC_STATIC, TOK_TYPE, TOK_USE_TMPL, TOK_USED, and TreeM.

Here is the call graph for this function:

◆ CreateAddrExpr()

tree_nodeRef tree_manipulation::CreateAddrExpr ( const tree_nodeConstRef tn,
const std::string &  srcp 
) const

Create an addr_expr.

Parameters
tnis the tree reindex of the object of which you want to take the address
srcpis the srcp to be associated with the call
Returns
the tree reindex of the created node

Definition at line 2727 of file tree_manipulation.cpp.

References align(), tree_manager::CGetTreeReindex(), tree_helper::CGetType(), tree_manager::create_tree_node(), tree_node::get_kind(), GetPointerType(), tree_node::index, tree_manager::new_tree_node_id(), STR, TOK, TOK_OP, TOK_SRCP, TOK_TYPE, and TreeM.

Referenced by CreateGimpleAssignAddrExpr(), and IR_lowering::InternalExec().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CreateAndExpr()

tree_nodeRef tree_manipulation::CreateAndExpr ( const tree_nodeConstRef first_condition,
const tree_nodeConstRef second_condition,
const blocRef &  block,
unsigned int  function_decl_nid 
) const

Create an or expression.

Parameters
first_conditionis the first condition
second_conditionis the second condition
blockis the basic block in which new statement has to be added
Returns
the ssa in the left part of the created statement

Create the and expr

Definition at line 2379 of file tree_manipulation.cpp.

References AppM, BUILTIN_SRCP, tree_manager::create_tree_node(), CreateGimpleAssign(), tree_manager::CreateUniqueIntegerCst(), GET_NODE, GetBooleanType(), tree_manager::GetTreeReindex(), tree_node::index, tree_manager::new_tree_node_id(), reuse, STR, THROW_ASSERT, TOK, TOK_OP0, TOK_OP1, TOK_SRCP, TOK_TYPE, and TreeM.

Referenced by Vectorize::AddGuards(), Schedule::EvaluateMultiWayIfsMerging(), multi_way_if::MergeCondCond(), multi_way_if::MergeCondMulti(), multi_way_if::MergeMultiCond(), and multi_way_if::MergeMultiMulti().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CreateCallExpr()

tree_nodeRef tree_manipulation::CreateCallExpr ( const tree_nodeConstRef called_function,
const std::vector< tree_nodeRef > &  args,
const std::string &  srcp 
) const

Create a call_expr.

Parameters
called_functionis the tree reindex of the called function
argsis the arguments of the call
srcpis the srcp to be associated with the call
Returns
the tree reindex of the created node

Definition at line 2698 of file tree_manipulation.cpp.

References test_panda::arg, tree_helper::CGetType(), tree_manager::create_tree_node(), GET_CONST_NODE, GetPointerType(), tree_manager::GetTreeReindex(), index, tree_node::index, tree_manager::new_tree_node_id(), STR, TOK, TOK_ARG, TOK_FN, TOK_OP, TOK_SRCP, TOK_TYPE, and TreeM.

Referenced by soft_float_cg_ext::generate_interface(), hls_div_cg_ext::recursive_examinate(), soft_float_cg_ext::RecursiveExaminate(), soft_float_cg_ext::replaceWithCall(), InterfaceInfer::setReadInterface(), InterfaceInfer::setWriteInterface(), and VersionFunctionCall().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CreateEqExpr()

tree_nodeRef tree_manipulation::CreateEqExpr ( const tree_nodeConstRef first_operand,
const tree_nodeConstRef second_operand,
const blocRef &  block,
unsigned int  function_decl_nid 
) const

Create an eq_expr.

Parameters
first_operandis the first operand
second_operandis the second operand
blockis the basic block in which new statement has to be added
Returns
the ssa in the left part of the created statement

Create the eq expr

Definition at line 2655 of file tree_manipulation.cpp.

References AppM, BUILTIN_SRCP, tree_manager::create_tree_node(), CreateGimpleAssign(), tree_manager::CreateUniqueIntegerCst(), GET_NODE, GetBooleanType(), tree_manager::GetTreeReindex(), tree_node::index, tree_manager::new_tree_node_id(), reuse, STR, THROW_ASSERT, TOK, TOK_OP0, TOK_OP1, TOK_SRCP, TOK_TYPE, and TreeM.

Here is the call graph for this function:

◆ CreateGimpleAssign()

tree_nodeRef tree_manipulation::CreateGimpleAssign ( const tree_nodeConstRef type,
const tree_nodeConstRef min,
const tree_nodeConstRef max,
const tree_nodeRef op,
unsigned int  function_decl_nid,
const std::string &  srcp 
) const

◆ CreateGimpleAssignAddrExpr()

tree_nodeRef tree_manipulation::CreateGimpleAssignAddrExpr ( const tree_nodeConstRef tn,
unsigned int  function_decl_nid,
const std::string &  srcp 
) const

Create a gimple_assign with op0 a new ssa_name, and op1 an addr_expr which takes the address of the tree node tn.

Parameters
tnis the tree reindex of the object of which you want to take the address
srcpis the srcp to be associated with the call
Returns
the tree reindex of the created node

Definition at line 2746 of file tree_manipulation.cpp.

References tree_manager::CGetTreeReindex(), CreateAddrExpr(), CreateGimpleAssign(), GET_NODE, tree_node::index, TreeM, and test_panda::type.

Referenced by compute_implicit_calls::replace_with_memcpy().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CreateIntegerCst()

tree_nodeRef tree_manipulation::CreateIntegerCst ( const tree_nodeConstRef type,
integer_cst_t  value,
const unsigned int  integer_cst_nid 
) const
private

CONST_OBJ_TREE_NODES.

Function used to create a integer_cst node.

Parameters
typeis the type of the node.
valueis the value of the constant
integer_cst_nidis the index node of the object to be created
Returns
the tree_reindex node of the integer_cst created.

Create an integer_cst node

Definition at line 724 of file tree_manipulation.cpp.

References tree_manager::create_tree_node(), debug_level, DEBUG_LEVEL_VERY_PEDANTIC, GET_INDEX_CONST_NODE, tree_node::get_kind(), GET_NODE, tree_manager::GetTreeReindex(), tree_node::index, PRINT_DBG_MEX, STR, THROW_ASSERT, TOK, TOK_TYPE, TOK_VALUE, and TreeM.

Referenced by GetBitsizeType(), GetCustomIntegerType(), GetSignedIntegerType(), GetSizeType(), GetUnsignedIntegerType(), and GetUnsignedLongLongType().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CreateNopExpr()

tree_nodeRef tree_manipulation::CreateNopExpr ( const tree_nodeConstRef operand,
const tree_nodeConstRef type,
const tree_nodeConstRef min,
const tree_nodeConstRef max,
unsigned int  function_decl_nid 
) const

Create a nop_expr to perform a conversion.

Parameters
operandis the operand to be converted
typeis the destination type
minis the minimum value of the assigned ssa_var
maxis the maximum value of the assigned ssa_var
Returns
the gimple assignment containing the nop expr as right part

THROW_ASSERT cannot be used since this function has to return an empty tree node in release

Definition at line 2529 of file tree_manipulation.cpp.

References BUILTIN_SRCP, tree_manager::create_tree_node(), CreateGimpleAssign(), GET_CONST_NODE, tree_node::get_kind(), GET_NODE, tree_manager::GetTreeReindex(), tree_node::index, max, min, tree_manager::new_tree_node_id(), STR, THROW_ASSERT, THROW_UNREACHABLE, TOK, TOK_OP, TOK_SRCP, TOK_TYPE, tree_node::ToString(), and TreeM.

Referenced by IR_lowering::expand_smod_pow2(), soft_float_cg_ext::generate_interface(), IR_lowering::InternalExec(), soft_float_cg_ext::InternalExec(), Bit_Value_opt::optimize(), FunctionCallTypeCleanup::ParametersTypeCleanup(), lut_transformation::ProcessBasicBlock(), InterfaceInfer::setReadInterface(), and InterfaceInfer::setWriteInterface().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CreateNotExpr()

tree_nodeRef tree_manipulation::CreateNotExpr ( const tree_nodeConstRef condition,
const blocRef &  block,
unsigned int  function_decl_nid 
) const

UTILITY.

Create a not expression if it does not exist in the basic block

Parameters
conditionis the operand of the not
blockis the basic block in which new statement has tobe added
Returns
the ssa in the left part of the created statement

Create the not expr

Definition at line 2421 of file tree_manipulation.cpp.

References AppM, BUILTIN_SRCP, tree_manager::create_tree_node(), CreateGimpleAssign(), tree_manager::CreateUniqueIntegerCst(), GET_NODE, GetBooleanType(), tree_manager::GetTreeReindex(), tree_node::index, tree_manager::new_tree_node_id(), reuse, STR, THROW_ASSERT, TOK, TOK_OP, TOK_SRCP, TOK_TYPE, and TreeM.

Referenced by Schedule::EvaluateMultiWayIfsMerging(), SerializeMutualExclusions::InternalExec(), multi_way_if::MergeCondCond(), multi_way_if::MergeCondMulti(), multi_way_if::MergeMultiCond(), multi_way_if::MergeMultiMulti(), and Bit_Value_opt::optimize().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CreateOrExpr()

tree_nodeRef tree_manipulation::CreateOrExpr ( const tree_nodeConstRef first_condition,
const tree_nodeConstRef second_condition,
const blocRef &  block,
unsigned int  function_decl_nid 
) const

Create an or expression.

Parameters
first_conditionis the first condition
second_conditionis the second condition
blockis the basic block in which new statement has to be added
Returns
the ssa in the left part of the created statement

Create the or expr

Definition at line 2336 of file tree_manipulation.cpp.

References AppM, BUILTIN_SRCP, tree_manager::create_tree_node(), CreateGimpleAssign(), tree_manager::CreateUniqueIntegerCst(), GET_NODE, GetBooleanType(), tree_manager::GetTreeReindex(), tree_node::index, tree_manager::new_tree_node_id(), reuse, STR, THROW_ASSERT, TOK, TOK_OP0, TOK_OP1, TOK_SRCP, TOK_TYPE, and TreeM.

Referenced by PhiOpt::ApplyMultiMerge(), PhiOpt::ApplyMultiRemove(), Schedule::EvaluateCondsMerging(), and Vectorize::Transform().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CreateUnsigned()

tree_nodeRef tree_manipulation::CreateUnsigned ( const tree_nodeConstRef signed_type) const

Create an unsigned integer type starting from signed type.

Definition at line 2561 of file tree_manipulation.cpp.

References tree_manager::create_tree_node(), tree_manager::find(), FIRST_TOKEN, GET_CONST_NODE, tree_helper::GetConstValue(), tree_manager::GetTreeReindex(), max, min, tree_manager::new_tree_node_id(), STR, THROW_ASSERT, THROW_ERROR, TOK, TOK_ALGN, TOK_MAX, TOK_MIN, TOK_NAME, TOK_PREC, TOK_QUAL, TOK_SIZE, TOK_STRG, TOK_UNSIGNED, TOK_VALUE, tree_node::ToString(), and TreeM.

Referenced by IR_lowering::expand_smod_pow2(), and IR_lowering::InternalExec().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CreateVectorBooleanType()

tree_nodeRef tree_manipulation::CreateVectorBooleanType ( const unsigned long long  number_of_elements) const

Create a vector bool type.

Parameters
number_of_elementsis the number of elements of a vector
Returns
the tree reindex of the created node

not_found decl

Definition at line 2759 of file tree_manipulation.cpp.

References BUILTIN_SRCP, tree_manager::create_tree_node(), tree_manager::CreateUniqueIntegerCst(), tree_manager::find(), GetBooleanType(), GetSizeType(), tree_manager::GetTreeReindex(), tree_manager::new_tree_node_id(), STR, TOK, TOK_ELTS, TOK_SIZE, TOK_SRCP, and TreeM.

Referenced by IR_lowering::InternalExec().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ExtractCondition()

tree_nodeRef tree_manipulation::ExtractCondition ( const tree_nodeRef condition,
const blocRef &  block,
unsigned int  function_decl_nid 
) const

Extract computation of condition from a gimple_cond.

Parameters
gcis the gimple_cond (already eliminated)
blockis the basic block in which new statement has to be added
Returns
the ssa in the left part of the created statement

Definition at line 2460 of file tree_manipulation.cpp.

References AppM, BUILTIN_SRCP, tree_helper::CGetType(), create_binary_operation(), CreateGimpleAssign(), tree_manager::CreateUniqueIntegerCst(), debug_level, DEBUG_LEVEL_VERY_PEDANTIC, GET_CONST_NODE, GET_NODE, GetBooleanType(), tree_helper::GetConstValue(), INDENT_DBG_MEX, tree_node::index, tree_helper::IsBooleanType(), reuse, STR, THROW_ASSERT, tree_node::ToString(), and TreeM.

Referenced by PhiOpt::ApplyIfMerge(), PhiOpt::ApplyIfRemove(), multi_way_if::MergeCondCond(), multi_way_if::MergeCondMulti(), and multi_way_if::MergeMultiCond().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetBitsizeType()

tree_nodeRef tree_manipulation::GetBitsizeType ( ) const

Function that creates a bit_size type if it is not already present, otherwise it returns the one that is already in the tree manager.

Create a bit_size type.

Returns
the tree_reindex node of the bit_size type.

@32 identifier_node strg: "bitsizetype" lngt: 13 @18 integer_type name: @32 size: @33 algn: 64 prec: 64 unsigned min : @34 max : @35 @33 integer_cst type: @18 low : 64 @34 integer_cst type: @18 low : 0 @35 integer_cst type: @18 low : -1

@32 identifier_node strg: "bitsizetype" lngt: 13 it is equivalent to "unsigned long long int"

@18 integer_type name: @32 size: @33 algn: 64 prec: 64 unsigned min : @34 max : @35

@32

not_found decl

@18 integer_type name: @32 size: @33 algn: 64 prec: 64 unsigned min : @34 max : @35

@33 integer_cst type: @18 low : 64

@34 integer_cst type: @18 low : 0

@35 integer_cst type: @18 low : -1

Definition at line 1047 of file tree_manipulation.cpp.

References ALGN_BIT_SIZE, create_identifier_node(), tree_manager::create_tree_node(), CreateIntegerCst(), debug_level, DEBUG_LEVEL_VERY_PEDANTIC, tree_manager::find(), GET_INDEX_CONST_NODE, GET_NODE, tree_manager::GetTreeReindex(), MAX_VALUE_BIT_SIZE, MIN_VALUE_BIT_SIZE, tree_manager::new_tree_node_id(), PREC_BIT_SIZE, PRINT_DBG_MEX, SIZE_VALUE_BIT_SIZE, STR, TOK, TOK_ALGN, TOK_MAX, TOK_MIN, TOK_NAME, TOK_PREC, TOK_SIZE, TOK_UNSIGNED, and TreeM.

Referenced by GetBooleanType(), GetCustomIntegerType(), GetFunctionType(), GetPointerType(), GetSignedIntegerType(), GetSizeType(), GetUnsignedIntegerType(), and GetUnsignedLongLongType().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetBooleanType()

tree_nodeRef tree_manipulation::GetBooleanType ( ) const

Function that creates a boolean type if it is not already present, otherwise it returns the one that is already in the tree manager.

Create a boolean type.

Returns
the tree_reindex node of the boolean type.

@48 boolean_type name: @55 size: @7 algn: 8 @55 type_decl name: @58 type: @48 srcp: "<built-in>:0:0" @58 identifier_node strg: "_Bool" lngt: 5 @7 integer_cst type: @21 low: 8 @21 is bit_size

@58 identifier_node strg: "_Bool" lngt: 5

@58

@55 type_decl name: @58 type: @48 srcp: "<built-in>:0:0"

not_found decl

@55 type_decl name: @58 type: @48 srcp: "<built-in>:0:0"

@48 boolean_type name: @55 size: @7 algn: 8

Definition at line 1173 of file tree_manipulation.cpp.

References ALGN_BOOLEAN, BUILTIN_SRCP, create_identifier_node(), tree_manager::create_tree_node(), tree_manager::CreateUniqueIntegerCst(), debug_level, DEBUG_LEVEL_VERY_PEDANTIC, tree_manager::find(), GET_INDEX_CONST_NODE, GET_NODE, GetBitsizeType(), tree_manager::GetTreeReindex(), tree_manager::new_tree_node_id(), PRINT_DBG_MEX, SIZE_VALUE_BOOL, STR, THROW_ERROR, TOK, TOK_ALGN, TOK_NAME, TOK_SIZE, TOK_SRCP, TOK_TYPE, and TreeM.

Referenced by Vectorize::AddGuards(), create_extract_bit_expr(), CreateAndExpr(), lut_transformation::CreateBitSelectionNodeOrCast(), CreateEqExpr(), CreateNotExpr(), CreateOrExpr(), CreateVectorBooleanType(), IR_lowering::division_by_a_constant(), InterfaceInfer::Exec(), IR_lowering::expand_sdiv_pow2(), IR_lowering::expand_smod_pow2(), ExtractCondition(), soft_float_cg_ext::generate_interface(), IR_lowering::InternalExec(), Bit_Value_opt::optimize(), lut_transformation::ProcessBasicBlock(), soft_float_cg_ext::RecursiveExaminate(), soft_float_cg_ext::replaceWithCall(), InterfaceInfer::setReadInterface(), and InterfaceInfer::setWriteInterface().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetCustomIntegerType()

tree_nodeRef tree_manipulation::GetCustomIntegerType ( unsigned long long  prec,
bool  unsigned_p 
) const

◆ GetFunctionType()

tree_nodeRef tree_manipulation::GetFunctionType ( const tree_nodeConstRef returnType,
const std::vector< tree_nodeConstRef > &  argsT 
) const

Create a function type.

Parameters
returnTypeis the return type
argsTis the vector of argument types
Returns
tree_nodeRef is the tree reindex associated with the function type created

Definition at line 1571 of file tree_manipulation.cpp.

References tree_manager::create_tree_node(), tree_manager::CreateUniqueIntegerCst(), GET_INDEX_CONST_NODE, GetBitsizeType(), tree_manager::GetTreeReindex(), tree_manager::new_tree_node_id(), SIZE_VALUE_FUNCTION, STR, TOK, TOK_ALGN, TOK_CHAN, TOK_PRMS, TOK_RETN, TOK_SIZE, TOK_VALU, and TreeM.

Referenced by create_function_decl(), and dead_code_eliminationIPA::signature_opt().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetPointerType()

tree_nodeRef tree_manipulation::GetPointerType ( const tree_nodeConstRef ptd,
unsigned long long  algn = 0 
) const

Function that creates a pointer type if it is not already present, otherwise it returns the one that is already in the tree manager.

Create a pointer type.

Parameters
ptdtype pointed by the pointer type (tree_reindex).
Returns
the tree_reindex node of the pointer type.

@15 pointer_type size: @12 algn: 32 ptd : @9 @9 type of the pointer @12 integer_cst type: @26 low : 32 @26 is bit_size_type

@12 integer_cst type: @26 low : 32 @26 is bit_size_type

Definition at line 1474 of file tree_manipulation.cpp.

References ALGN_POINTER_M32, ALGN_POINTER_M64, tree_manager::create_tree_node(), tree_manager::CreateUniqueIntegerCst(), debug_level, DEBUG_LEVEL_VERY_PEDANTIC, tree_manager::find(), GetBitsizeType(), tree_manager::GetTreeReindex(), tree_node::index, tree_manager::new_tree_node_id(), parameters, PRINT_DBG_MEX, SIZE_VALUE_POINTER_M32, SIZE_VALUE_POINTER_M64, STR, TOK, TOK_ALGN, TOK_PTD, TOK_SIZE, and TreeM.

Referenced by IR_lowering::array_ref_lowering(), create_gimple_call(), CreateAddrExpr(), CreateCallExpr(), IR_lowering::expand_target_mem_ref(), IR_lowering::InternalExec(), BehavioralHelper::PrintNode(), BehavioralHelper::PrintVariable(), soft_float_cg_ext::RecursiveExaminate(), compute_implicit_calls::replace_with_memcpy(), InterfaceInfer::setReadInterface(), InterfaceInfer::setWriteInterface(), soft_float_cg_ext::signature_lowering(), dead_code_eliminationIPA::signature_opt(), and soft_float_cg_ext::soft_float_cg_ext().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetSignedIntegerType()

tree_nodeRef tree_manipulation::GetSignedIntegerType ( ) const

Function that creates a integer type if it is not already present, otherwise it returns the one that is already in the tree manager.

Create an integer type.

Returns
the tree_reindex node of the integer type.

@36 identifier_node strg: "int" lngt: 3 @19 type_decl name: @36 type: @8 srcp: "<built-in>:0:0" @8 integer_type name: @19 size: @11 algn: 32 prec: 32 min : @20 max : @21 @11 integer_cst type: @18 low : 32 @20 integer_cst type: @8 high: -1 low : -2147483648 @21 integer_cst type: @8 low : 2147483647

@36 identifier_node strg: "int" lngt: 3

@36

@19 type_decl name: @36 type: @8 srcp: "<built-in>:0:0"

not_found decl

@11 integer_cst type: @18 low : 32

@20 type_decl name: @41 type: @8 srcp: "<built-in>:0:0"

@8 integer_type name: @19 size: @11 algn: 32 prec: 32 min : @20 max : @21

@20 integer_cst type: @8 high: -1 low : -2147483648

@21 integer_cst type: @8 low : 2147483647

Definition at line 1386 of file tree_manipulation.cpp.

References ALGN_INT, BUILTIN_SRCP, create_identifier_node(), tree_manager::create_tree_node(), CreateIntegerCst(), tree_manager::CreateUniqueIntegerCst(), debug_level, DEBUG_LEVEL_VERY_PEDANTIC, tree_manager::find(), GET_INDEX_CONST_NODE, GET_NODE, GetBitsizeType(), tree_manager::GetTreeReindex(), MAX_VALUE_INT, MIN_VALUE_INT, tree_manager::new_tree_node_id(), PREC_INT, PRINT_DBG_MEX, SIZE_VALUE_INT, STR, THROW_ERROR, TOK, TOK_ALGN, TOK_MAX, TOK_MIN, TOK_NAME, TOK_PREC, TOK_SIZE, TOK_SRCP, TOK_TYPE, TOK_UNSIGNED, and TreeM.

Referenced by soft_float_cg_ext::generate_interface(), rebuild_initialization::InternalExec(), rebuild_initialization2::look_for_ROMs(), soft_float_cg_ext::RecursiveExaminate(), and soft_float_cg_ext::replaceWithCall().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetSizeType()

tree_nodeRef tree_manipulation::GetSizeType ( ) const

create a sizetype builtin type in case it has not already been created, otherwise it returns the one found in the tree manager.

Create a size type.

@32 identifier_node strg: "sizetype" lngt: 13 @18 integer_type name: @32 size: @33 algn: 64 prec: 64 unsigned min : @34 max : @35 @33 integer_cst type: @18 low : 64 @34 integer_cst type: @18 low : 0 @35 integer_cst type: @18 low : -1

sizetype will translated in unsigned long

@124

not_found decl

@18 integer_type name: @32 size: @33 algn: 64 prec: 64 unsigned min : @34 max : @35

@34 integer_cst type: @18 low : 0

@35 integer_cst type: @18 low : -1

Definition at line 1109 of file tree_manipulation.cpp.

References ALGN_BIT_SIZE, create_identifier_node(), tree_manager::create_tree_node(), CreateIntegerCst(), tree_manager::CreateUniqueIntegerCst(), debug_level, DEBUG_LEVEL_VERY_PEDANTIC, tree_manager::find(), GET_INDEX_CONST_NODE, GET_NODE, GetBitsizeType(), tree_manager::GetTreeReindex(), MAX_VALUE_BIT_SIZE, MIN_VALUE_BIT_SIZE, tree_manager::new_tree_node_id(), PREC_BIT_SIZE, PRINT_DBG_MEX, SIZE_VALUE_BIT_SIZE, STR, TOK, TOK_ALGN, TOK_MAX, TOK_MIN, TOK_NAME, TOK_PREC, TOK_SIZE, TOK_UNSIGNED, and TreeM.

Referenced by IR_lowering::array_ref_lowering(), CreateVectorBooleanType(), IR_lowering::expand_target_mem_ref(), and IR_lowering::InternalExec().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetUnsignedIntegerType()

tree_nodeRef tree_manipulation::GetUnsignedIntegerType ( ) const

Function that creates a unsigned integer type if it is not already present, otherwise it returns the one that is already in the tree manager.

Create an unsigned integer type.

Returns
the tree_reindex node of the unsigned integer type.

@41 identifier_node strg: "unsigned int" lngt: 12 @8 integer_type name: @20 size: @12 algn: 32 prec: 32 unsigned min : @21 max : @22 @20 type_decl name: @41 type: @8 srcp: "<built-in>:0:0" @12 integer_cst type: @18 low : 32 @21 integer_cst type: @8 low : 0 @22 integer_cst type: @8 low : -1

@41 identifier_node strg: "unsigned int" lngt: 12

@41

@20 type_decl name: @41 type: @8 srcp: "<built-in>:0:0"

not_found decl

@20 type_decl name: @41 type: @8 srcp: "<built-in>:0:0"

@8 integer_type name: @20 size: @12 algn: 32 prec: 32 unsigned min : @21 max : @22

@21 integer_cst type: @8 low : 0

@22 integer_cst type: @8 low : -1

Definition at line 1239 of file tree_manipulation.cpp.

References ALGN_UNSIGNED_INT, BUILTIN_SRCP, create_identifier_node(), tree_manager::create_tree_node(), CreateIntegerCst(), tree_manager::CreateUniqueIntegerCst(), debug_level, DEBUG_LEVEL_VERY_PEDANTIC, tree_manager::find(), GET_INDEX_CONST_NODE, GET_NODE, GetBitsizeType(), tree_manager::GetTreeReindex(), MAX_VALUE_UNSIGNED_INT, MIN_VALUE_UNSIGNED_INT, tree_manager::new_tree_node_id(), PREC_UNSIGNED_INT, PRINT_DBG_MEX, SIZE_VALUE_UNSIGNED_INT, STR, THROW_ERROR, TOK, TOK_ALGN, TOK_MAX, TOK_MIN, TOK_NAME, TOK_PREC, TOK_SIZE, TOK_SRCP, TOK_TYPE, TOK_UNSIGNED, and TreeM.

Referenced by InterfaceInfer::Exec(), InterfaceInfer::setReadInterface(), InterfaceInfer::setWriteInterface(), and Vectorize::Transform().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetUnsignedLongLongType()

tree_nodeRef tree_manipulation::GetUnsignedLongLongType ( ) const

◆ GetVoidType()

tree_nodeRef tree_manipulation::GetVoidType ( ) const

TYPE_OBJ.

Function that creates a void type if it is not already present, otherwise it returns the one that is already in the tree manager.

Returns
the tree_reindex node of the void type.

Create a void type

@41 void_type name: @58 algn: 8 @58 type_decl name: @63 type: @41 srcp: "<built-in>:0:0" @63 identifier_node strg: "void" lngt: 4

Create the void_type @41 void_type name: @58 algn: 8

Create the type_decl @58 type_decl name: @63 type: @41 srcp: BUILTIN_SRCP

Definition at line 998 of file tree_manipulation.cpp.

References ALGN_VOID, BUILTIN_SRCP, create_identifier_node(), tree_manager::create_tree_node(), debug_level, DEBUG_LEVEL_VERY_PEDANTIC, tree_manager::find(), GET_INDEX_CONST_NODE, GET_NODE, tree_manager::GetTreeReindex(), tree_manager::new_tree_node_id(), PRINT_DBG_MEX, STR, TOK, TOK_ALGN, TOK_NAME, TOK_SRCP, TOK_TYPE, and TreeM.

Referenced by create_gimple_cond(), create_gimple_return(), InterfaceInfer::Exec(), and InterfaceInfer::setWriteInterface().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ InlineFunctionCall()

unsigned int tree_manipulation::InlineFunctionCall ( const tree_nodeRef call_node,
const tree_nodeRef caller_node 
)

Execute function call inlining of given call statement (call graph must be recomputed after inlining)

Parameters
call_stmttree node of the call statement to inline
caller_nodecaller function tree node
Returns
unsigned int exit basic block number where statements after inlined call have been moved

Definition at line 2807 of file tree_manipulation.cpp.

References AppM, test_panda::arg, test_panda::args, tree_manager::CGetTreeNode(), tree_helper::ComputeSsaUses(), create_phi_node(), bloc::ENTRY_BLOCK_ID, bloc::EXIT_BLOCK_ID, GET_CONST_NODE, GET_INDEX_CONST_NODE, tree_node::get_kind(), GET_NODE, INDENT_OUT_MEX, max, OUTPUT_LEVEL_MINIMUM, parameters, phi, tree_helper::print_function_name(), RENAME, tree_manager::ReplaceTreeNode(), sl, STR, THROW_ASSERT, THROW_UNREACHABLE, and TreeM.

Referenced by FunctionCallOpt::InternalExec().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ VersionFunctionCall()

bool tree_manipulation::VersionFunctionCall ( const tree_nodeRef call_node,
const tree_nodeRef caller_node,
const std::string &  version_suffix 
)

Perform function call versioning.

Parameters
call_nodeCall statement tree node
caller_nodeCaller function tree node
version_suffixSuffix applied to the versioned function name
Returns
bool true if versioning happened, false if function was already versioned

Definition at line 3031 of file tree_manipulation.cpp.

References CallGraphManager::addCallPointAndExpand(), AppM, test_panda::args, BUILTIN_SRCP, CloneFunction(), create_gimple_call(), CreateCallExpr(), debug_level, DEBUG_LEVEL_NONE, DEBUG_LEVEL_VERY_PEDANTIC, FunctionEdgeInfo::direct_call, ends_with(), GET_CONST_NODE, GET_INDEX_CONST_NODE, GET_NODE, tree_helper::GetFunctionName(), INDENT_DBG_MEX, tree_manager::ReplaceTreeNode(), STR, THROW_ASSERT, THROW_UNREACHABLE, and TreeM.

Referenced by dataflow_cg_ext::InternalExec(), and FunctionCallOpt::InternalExec().

Here is the call graph for this function:
Here is the caller graph for this function:

Field Documentation

◆ AppM

const application_managerRef tree_manipulation::AppM
private

◆ debug_level

const int tree_manipulation::debug_level
private

◆ goto_label_unique_id

unsigned int tree_manipulation::goto_label_unique_id = 0
staticprivate

store a unique id used during the creation of the label_decl associated with a gimple_goto.

Definition at line 134 of file tree_manipulation.hpp.

Referenced by create_label().

◆ parameters

const ParameterConstRef tree_manipulation::parameters
private

The set of input parameters.

Definition at line 128 of file tree_manipulation.hpp.

Referenced by GetPointerType(), and InlineFunctionCall().

◆ reuse

const bool tree_manipulation::reuse
private

True if statements can be reused.

Definition at line 125 of file tree_manipulation.hpp.

Referenced by CreateAndExpr(), CreateEqExpr(), CreateNotExpr(), CreateOrExpr(), and ExtractCondition().

◆ TreeM

tree_managerRef tree_manipulation::TreeM
private

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

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