PandA-2024.02
|
This class creates a layer to add nodes and to manipulate the tree_nodes manager. More...
#include <tree_manipulation.hpp>
Public Member Functions | |
tree_manipulation (const tree_managerRef &TreeM, const ParameterConstRef ¶meters, const application_managerRef _AppM) | |
This is the constructor of the tree_manipulation. More... | |
tree_manipulation (const tree_managerRef &TreeM, const ParameterConstRef ¶meters, 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... | |
This class creates a layer to add nodes and to manipulate the tree_nodes manager.
Definition at line 115 of file tree_manipulation.hpp.
tree_manipulation::tree_manipulation | ( | const tree_managerRef & | TreeM, |
const ParameterConstRef & | parameters, | ||
const application_managerRef | _AppM | ||
) |
This is the constructor of the tree_manipulation.
Constructor.
TreeM | is the tree manager. |
parameters | is the set of input parameters |
Definition at line 74 of file tree_manipulation.cpp.
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().
|
default |
This is the destructor of the tree_manipulation.
Destructor.
Referenced by tree_manipulation().
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.
bb | is the basic block. |
predecessor | is the predecessor. |
Definition at line 1992 of file tree_manipulation.cpp.
Referenced by 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.
bb | is the basic block. |
predecessors | is the vector of predecessors. |
Definition at line 1983 of file tree_manipulation.cpp.
References bb_add_predecessor().
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.
bb | is the basic block. |
stmt | is 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().
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.
bb | is the basic block. |
stmt | is the vector of statements. |
Insert the list of statement
Definition at line 1948 of file tree_manipulation.cpp.
References bb_add_stmt().
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.
bb | is the basic block. |
successor | is the successor. |
Definition at line 1977 of file tree_manipulation.cpp.
Referenced by 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.
bb | is the basic block. |
successors | is the vector of successors. |
Definition at line 1968 of file tree_manipulation.cpp.
References bb_add_successor().
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.
bb | is the basic block. |
Definition at line 2038 of file tree_manipulation.cpp.
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.
bb | is the basic block. |
Definition at line 2044 of file tree_manipulation.cpp.
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.
bb | is the basic block. |
predecessor | is 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().
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.
bb | is the basic block. |
predecessors | is the vector of predecessors. |
Definition at line 2018 of file tree_manipulation.cpp.
References bb_remove_predecessor().
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.
bb | is the basic block. |
successor | is 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().
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.
bb | is the basic block. |
successors | is the vector of successors. |
Definition at line 1998 of file tree_manipulation.cpp.
References bb_remove_successor().
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.
bb | is the basic block. |
false_edge_index | is the index of the then basic block. |
Definition at line 2050 of file tree_manipulation.cpp.
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.
bb | is the basic block. |
true_edge_index | is the index of the if basic block. |
Definition at line 2056 of file tree_manipulation.cpp.
tree_nodeRef tree_manipulation::CloneFunction | ( | const tree_nodeRef & | tn, |
const std::string & | funNameSuffix | ||
) |
CloneFunction duplicates a function.
tn | is the tree reindex of the function decl |
funNameSuffix | is the suffix added to function_decl newly created |
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().
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.
list_of_bloc | is the list of basic blocks. |
predecessors | is the list of predecessors of the basic block to be created (indexes of the blocks). |
successors | is the list of successors of the basic block to be created (indexes of the blocks). |
stmt | is the list of the stmt node to be inserted in the basic block (tree_reindex nodes). |
number | is the new basic block number |
true_edge | is the index of the basic block it goes if there is a jump expression and the condition is satisfied (default=0). |
false_edge | is the index of the basic block it goes if there is a jump expression and the condition is not satisfied (default=0). |
phi | is the list of the gimple_phi to be inserted (default empty). |
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.
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.
type | is the type of the expression (tree_reindex). |
op0 | is the first operand of the binary expression (tree_reindex). |
op1 | is the second operand of the binary expression (tree_reindex). |
srcp | is the definition of the source position. |
operation_kind | is the kind of binary expression to create (bit_and_expr_K, plus_expr_K,...). |
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().
tree_nodeRef tree_manipulation::create_extract_bit_expr | ( | const tree_nodeRef & | op0, |
const tree_nodeRef & | op1, | ||
const std::string & | srcp | ||
) | const |
Definition at line 698 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, GetBooleanType(), tree_manager::GetTreeReindex(), tree_manager::new_tree_node_id(), PRINT_DBG_MEX, STR, THROW_ASSERT, TOK, TOK_OP0, TOK_OP1, TOK_SRCP, TOK_TYPE, and TreeM.
Referenced by lut_transformation::CreateBitSelectionNodeOrCast(), and Bit_Value_opt::optimize().
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
function_name | is the function name |
scpe | is the function scope |
argsT | is the vector of argument types |
returnType | is the return type |
srcp | is the source references |
with_body | when true a stub of the body is 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().
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 |
GIMPLE_CALL.
Definition at line 1722 of file tree_manipulation.cpp.
References test_panda::arg, tree_helper::CGetType(), tree_manager::create_tree_node(), debug_level, DEBUG_LEVEL_VERY_PEDANTIC, GET_CONST_NODE, GetPointerType(), tree_manager::GetTreeReindex(), INDENT_DBG_MEX, index, tree_node::index, tree_manager::new_tree_node_id(), STR, THROW_ASSERT, TOK, TOK_ARG, TOK_FN, TOK_OP, TOK_SCPE, TOK_SRCP, TOK_TYPE, and TreeM.
Referenced by InterfaceInfer::Exec(), compute_implicit_calls::replace_with_memcpy(), compute_implicit_calls::replace_with_memset(), InterfaceInfer::setWriteInterface(), and VersionFunctionCall().
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.
expr | is the condition and can be of any type. |
srcp | is the definition of the source position. |
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().
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 |
GIMPLE_ASSIGN.
Function used to create a gimple_assign.
op0 | is the first operand. |
op1 | is the second operand. |
scpe | is the scope of the gimple assign. |
srcp | is the definition of the source position. |
Create a gimple_assign
Definition at line 1684 of file tree_manipulation.cpp.
References 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(), tree_manager::GetTreeReindex(), INDENT_DBG_MEX, tree_manager::new_tree_node_id(), tree_helper::Size(), STR, THROW_ASSERT, TOK, TOK_OP0, TOK_OP1, TOK_SCPE, TOK_SRCP, ToString(), and TreeM.
Referenced by PhiOpt::ApplyIfMerge(), PhiOpt::ApplyIfRemove(), PhiOpt::ApplyMultiMerge(), PhiOpt::ApplyMultiRemove(), CreateGimpleAssign(), Vectorize::FixPhis(), PhiOpt::IdentifyPattern(), commutative_expr_restructuring::InternalExec(), InterfaceInfer::setReadInterface(), InterfaceInfer::setWriteInterface(), Vectorize::Transform(), and virtual_phi_nodes_split::virtual_split_phi().
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.
type | is the type of the expression returned. |
expr | is the value to return. |
srcp | is the definition of the source position. |
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.
void tree_manipulation::create_goto | ( | const blocRef & | block, |
unsigned int | function_decl_nid, | ||
unsigned int | label_expr_nid | ||
) | const |
create a goto expression.
block | is the basic block where the goto expression has to be inserted. |
function_decl_nid | is the node id of the function where the goto expression is defined. |
label_expr_nid | is 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.
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.
strg | is the identifier string associated with the identifier_node. |
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().
void tree_manipulation::create_label | ( | const blocRef & | block, |
unsigned int | function_decl_nid | ||
) | const |
create a label expression in a header of a loop.
block | is the basic block where the label expression has to be inserted. |
function_decl_nid | is 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.
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
type | is the type of the expression (tree_reindex). |
op0 | describes the LUT functionality as a constant integer. |
op1 | is the first operand of the lut_expr expression (tree_reindex). |
op2 | is the second operand of the lut_expr expression (tree_reindex). |
op3 | is the third operand of the lut_expr expression (tree_reindex). |
op4 | is the fourth operand of the lut_expr expression (tree_reindex). |
op5 | is the fifth operand of the lut_expr expression (tree_reindex). |
op6 | is the sixth operand of the lut_expr expression (tree_reindex). |
op7 | is the seventh operand of the lut_expr expression (tree_reindex). |
op8 | is the eighth operand of the lut_expr expression (tree_reindex). |
srcp | is the definition of the source position. |
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().
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.
name | is the name field containing an identifier_node used to represent a name. |
type | is the type. |
scpe | is the scope declaration. |
size | is the size field holding the size of datum, in bits. |
argt | is the type in which the argument is actually passed. |
smt_ann | is the symbol_memory_tag annotation. |
init | is the init field holding the value to initialize a variable to. |
srcp | is the definition of the source position. |
used | is nonzero if the name is used in its scope |
register_flag | means declared 'register' |
readonly_flag | means declared 'readonly' |
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().
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.
ssa_res | is the new ssa_name node created by the phi node. |
list_of_def_edge | vector where each tuple contains the incoming reaching definition (ssa_name node) and the edge via which that definition is coming through. |
virtual_flag | flag to set if it is a virtual gimple_phi (default false). |
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().
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.
type | is the type of the expression (tree_reindex). |
op0 | is the first operand of the quaternary expression (tree_reindex). |
op1 | is the second operand of the quaternary expression (tree_reindex). |
op2 | is the third operand of the quaternary expression (tree_reindex). |
op3 | is the fourth operand of the quaternary expression (tree_reindex). |
srcp | is the definition of the source position. |
operation_kind | is the kind of quaternary expression to create (array_range_ref_K, array_ref_K). |
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.
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.
name | is the name field containing an identifier_node used to represent a name. |
type | is the type. |
scpe | is the scope declaration. |
size | is the size field holding the size of datum, in bits. |
smt_ann | is the symbol_memory_tag annotation (default empty). |
init | is the init field holding the value to initialize a variable to. |
srcp | is the definition of the source position. |
algn | is the field holding the alignment required for the datum, in bits. |
artificial_flag | used to indicate that this decl_node represents a compiler-generated entity (default false). |
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.
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.
var | is the variable being referenced. |
type | is the type of the ssa_node |
min | is the minimum value of the ssa_var |
max | is the maximum value of the ssa_var |
volatile_flag | flag set to true in case a ssa_name is never defined (default false). |
virtual_flag | flag for virtual phi (default false). |
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().
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.
type | is the type of the expression (tree_reindex). |
op0 | is the first operand of the ternary expression (tree_reindex). |
op1 | is the second operand of the ternary expression (tree_reindex). |
op2 | is the third operand of the ternary expression (tree_reindex). |
srcp | is the definition of the source position. |
operation_kind | is the kind of ternary expression to create (component_ref_K, gimple_switch_K,...). |
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().
tree_nodeRef tree_manipulation::create_translation_unit_decl | ( | ) | const |
create or find a global scope
Definition at line 848 of file tree_manipulation.cpp.
References BUILTIN_SRCP, 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_SRCP, and TreeM.
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.
type | is the type of the expression (tree_reindex). |
op | is the operand of the unary expression (tree_reindex). |
srcp | is the definition of the source position. |
operation_kind | is the kind of unary expression to create (bit_not_expr_K, nop_expr_K,...). |
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().
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.
name | is the name field containing an identifier_node used to represent a name. |
type | is the type. |
scpe | is the scope declaration. |
size | is the size field holding the size of datum, in bits. |
smt_ann | is the symbol_memory_tag annotation. |
init | is the init field holding the value to initialize a variable to. |
srcp | is the definition of the source position. |
algn | is the field holding the alignment required for the datum, in bits. |
used | is nonzero if the name is used in its scope |
artificial_flag | used to indicate that this decl_node represents a compiler-generated entity (default false). |
use_tmpl | indicates whether or not (and how) a template was expanded for this VAR_DECL (default -1). |
static_static_flag | to manage C++ code with static member (default false). |
static_flag | to manage standard static attribute (default false). |
extern_flag | a variable can be extern (default false). |
init | field holds the value to initialize a variable to (default false). |
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.
tree_nodeRef tree_manipulation::CreateAddrExpr | ( | const tree_nodeConstRef & | tn, |
const std::string & | srcp | ||
) | const |
Create an addr_expr.
tn | is the tree reindex of the object of which you want to take the address |
srcp | is the srcp to be associated with the call |
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().
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.
first_condition | is the first condition |
second_condition | is the second condition |
block | is the basic block in which new statement has to be added |
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().
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.
called_function | is the tree reindex of the called function |
args | is the arguments of the call |
srcp | is the srcp to be associated with the call |
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().
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.
first_operand | is the first operand |
second_operand | is the second operand |
block | is the basic block in which new statement has to be added |
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.
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 |
Create gimple assignment.
type | is the type the assignment |
min | is the minimum value of the assigned ssa_var |
max | is the maximum value of the assigned ssa_var |
op | is the right part |
srcp | is the srcp to be assigned |
Definition at line 1711 of file tree_manipulation.cpp.
References create_gimple_modify_stmt(), create_ssa_name(), tree_manager::GetTreeNode(), tree_manager::GetTreeReindex(), tree_node::index, and TreeM.
Referenced by IR_lowering::array_ref_lowering(), CreateAndExpr(), lut_transformation::CreateBitSelectionNodeOrCast(), CreateEqExpr(), CreateGimpleAssignAddrExpr(), CreateNopExpr(), CreateNotExpr(), CreateOrExpr(), 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::generate_interface(), SerializeMutualExclusions::InternalExec(), IR_lowering::InternalExec(), soft_float_cg_ext::InternalExec(), Bit_Value_opt::optimize(), FunctionCallTypeCleanup::ParametersTypeCleanup(), lut_transformation::ProcessBasicBlock(), InterfaceInfer::setReadInterface(), InterfaceInfer::setWriteInterface(), and soft_float_cg_ext::ssa_lowering().
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.
tn | is the tree reindex of the object of which you want to take the address |
srcp | is the srcp to be associated with the call |
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().
|
private |
CONST_OBJ_TREE_NODES.
Function used to create a integer_cst node.
type | is the type of the node. |
value | is the value of the constant |
integer_cst_nid | is the index node of the object to be 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().
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.
operand | is the operand to be converted |
type | is the destination type |
min | is the minimum value of the assigned ssa_var |
max | is the maximum value of the assigned ssa_var |
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().
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
condition | is the operand of the not |
block | is the basic block in which new statement has tobe added |
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().
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.
first_condition | is the first condition |
second_condition | is the second condition |
block | is the basic block in which new statement has to be added |
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().
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().
tree_nodeRef tree_manipulation::CreateVectorBooleanType | ( | const unsigned long long | number_of_elements | ) | const |
Create a vector bool type.
number_of_elements | is the number of elements of a vector |
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().
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.
gc | is the gimple_cond (already eliminated) |
block | is the basic block in which new statement has to be added |
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().
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.
@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().
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.
@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().
tree_nodeRef tree_manipulation::GetCustomIntegerType | ( | unsigned long long | prec, |
bool | unsigned_p | ||
) | const |
create an integer type starting from a given prec
prec | is the required integer_type precision |
unsigned_p | say if the integer_type required is unsigned or not |
Definition at line 1513 of file tree_manipulation.cpp.
References tree_manager::create_tree_node(), CreateIntegerCst(), tree_manager::CreateUniqueIntegerCst(), tree_manager::find(), get_aligned_bitsize(), GET_INDEX_CONST_NODE, GET_NODE, GetBitsizeType(), tree_manager::GetTreeReindex(), tree_manager::new_tree_node_id(), STR, TOK, TOK_ALGN, TOK_MAX, TOK_MIN, TOK_PREC, TOK_SIZE, TOK_UNSIGNED, and TreeM.
Referenced by soft_float_cg_ext::cstCast(), InterfaceInfer::Exec(), soft_float_cg_ext::floatAbs(), soft_float_cg_ext::floatNegate(), soft_float_cg_ext::generate_interface(), IR_lowering::InternalExec(), soft_float_cg_ext::RecursiveExaminate(), InterfaceInfer::setReadInterface(), InterfaceInfer::setWriteInterface(), and soft_float_cg_ext::soft_float_cg_ext().
tree_nodeRef tree_manipulation::GetFunctionType | ( | const tree_nodeConstRef & | returnType, |
const std::vector< tree_nodeConstRef > & | argsT | ||
) | const |
Create a function type.
returnType | is the return type |
argsT | is the vector of argument types |
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().
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.
ptd | type pointed by the pointer type (tree_reindex). |
@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().
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.
@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().
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().
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.
@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().
tree_nodeRef tree_manipulation::GetUnsignedLongLongType | ( | ) | const |
Function that creates a long long unsigned int type if it is not already present, otherwise return the existing type.
@41
not_found decl
@21 integer_cst type: @8 low : 0
@21 integer_cst type: @8 low : -1
Definition at line 1322 of file tree_manipulation.cpp.
References ALGN_UNSIGNED_LONG_LONG_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(), INDENT_DBG_MEX, MAX_VALUE_UNSIGNED_LONG_LONG_INT, MIN_VALUE_UNSIGNED_LONG_LONG_INT, tree_manager::new_tree_node_id(), PREC_UNSIGNED_LONG_LONG_INT, PRINT_DBG_MEX, SIZE_VALUE_UNSIGNED_LONG_LONG_INT, STR, TOK, TOK_ALGN, TOK_MAX, TOK_MIN, TOK_NAME, TOK_PREC, TOK_SIZE, TOK_SRCP, TOK_TYPE, TOK_UNSIGNED, and TreeM.
Referenced by lut_transformation::CreateBitSelectionNodeOrCast(), Bit_Value_opt::optimize(), and lut_transformation::ProcessBasicBlock().
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.
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().
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)
call_stmt | tree node of the call statement to inline |
caller_node | caller function tree node |
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().
bool tree_manipulation::VersionFunctionCall | ( | const tree_nodeRef & | call_node, |
const tree_nodeRef & | caller_node, | ||
const std::string & | version_suffix | ||
) |
Perform function call versioning.
call_node | Call statement tree node |
caller_node | Caller function tree node |
version_suffix | Suffix applied to the versioned function name |
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().
|
private |
Application manager data structure.
Definition at line 122 of file tree_manipulation.hpp.
Referenced by bb_add_stmt(), CloneFunction(), create_basic_block(), create_goto(), create_label(), CreateAndExpr(), CreateEqExpr(), CreateNotExpr(), CreateOrExpr(), ExtractCondition(), InlineFunctionCall(), and VersionFunctionCall().
|
private |
debug level.
Definition at line 131 of file tree_manipulation.hpp.
Referenced by bb_add_stmt(), bb_remove_predecessor(), bb_remove_successor(), create_basic_block(), create_binary_operation(), create_extract_bit_expr(), create_gimple_call(), create_gimple_cond(), create_gimple_modify_stmt(), create_gimple_return(), create_identifier_node(), create_lut_expr(), create_parm_decl(), create_phi_node(), create_quaternary_operation(), create_result_decl(), create_ssa_name(), create_ternary_operation(), create_translation_unit_decl(), create_unary_operation(), create_var_decl(), CreateIntegerCst(), ExtractCondition(), GetBitsizeType(), GetBooleanType(), GetPointerType(), GetSignedIntegerType(), GetSizeType(), GetUnsignedIntegerType(), GetUnsignedLongLongType(), GetVoidType(), and VersionFunctionCall().
|
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().
|
private |
The set of input parameters.
Definition at line 128 of file tree_manipulation.hpp.
Referenced by GetPointerType(), and InlineFunctionCall().
|
private |
True if statements can be reused.
Definition at line 125 of file tree_manipulation.hpp.
Referenced by CreateAndExpr(), CreateEqExpr(), CreateNotExpr(), CreateOrExpr(), and ExtractCondition().
|
private |
Tree Manager.
Definition at line 119 of file tree_manipulation.hpp.
Referenced by CloneFunction(), create_binary_operation(), create_extract_bit_expr(), create_function_decl(), create_gimple_call(), create_gimple_cond(), create_gimple_modify_stmt(), create_gimple_return(), create_goto(), create_identifier_node(), create_label(), create_lut_expr(), create_parm_decl(), create_phi_node(), create_quaternary_operation(), create_result_decl(), create_ssa_name(), create_ternary_operation(), create_translation_unit_decl(), create_unary_operation(), create_var_decl(), CreateAddrExpr(), CreateAndExpr(), CreateCallExpr(), CreateEqExpr(), CreateGimpleAssign(), CreateGimpleAssignAddrExpr(), CreateIntegerCst(), CreateNopExpr(), CreateNotExpr(), CreateOrExpr(), CreateUnsigned(), CreateVectorBooleanType(), ExtractCondition(), GetBitsizeType(), GetBooleanType(), GetCustomIntegerType(), GetFunctionType(), GetPointerType(), GetSignedIntegerType(), GetSizeType(), GetUnsignedIntegerType(), GetUnsignedLongLongType(), GetVoidType(), InlineFunctionCall(), and VersionFunctionCall().