PandA-2024.02
|
This class collects some utility functions used to extract information from tree-based data structures. More...
#include <tree_helper.hpp>
Public Member Functions | |
tree_helper () | |
Constructor. More... | |
~tree_helper () | |
Destructor. More... | |
Static Public Member Functions | |
static unsigned long long | Size (const tree_nodeConstRef &tn) |
Return the size of a tree object. More... | |
static std::string | GetTemplateTypeName (const tree_nodeConstRef &type) |
Return the name of template without parameters. More... | |
static std::string | GetRecordTypeName (const tree_nodeConstRef &type) |
Return the name of the class. More... | |
static std::string | name_function (const tree_managerConstRef &tm, const unsigned int index) |
Return the name of the function. More... | |
static std::string | GetFunctionName (const tree_managerConstRef &TM, const tree_nodeConstRef &decl) |
Return the name of the function. More... | |
static std::tuple< std::string, unsigned int, unsigned int > | GetSourcePath (const tree_nodeConstRef &node, bool &is_system) |
Return where a function or a type is defined. More... | |
static bool | has_function_return (const tree_managerConstRef &tm, const unsigned int index) |
Return true if the function index returns a not void type, false otherwise. More... | |
static bool | HasReturnType (const tree_managerConstRef &tm, const unsigned int index) |
Return true if the function index returns a not void type, false otherwise. More... | |
static std::string | getFunctionTypeString (const tree_nodeRef &FT) |
Return a string describing the functino type. More... | |
static void | get_used_variables (bool first_level_only, const tree_nodeConstRef &t, CustomUnorderedSet< unsigned int > &list_of_variable) |
Return the list of tree nodes associated with the variable used by the node t. More... | |
static bool | look_for_binfo_inheritance (const binfo *b, const std::string &bcs) |
Look for inheritance of a class. More... | |
static tree_nodeRef | find_obj_type_ref_function (const tree_nodeConstRef &tn) |
Given the tree_node of an obj_type_ref return the tree_node of the called function. More... | |
static std::set< tree_nodeConstRef, TreeNodeConstSorter > | GetTypesToBeDeclaredBefore (const tree_nodeConstRef &tn, const bool without_transformation) |
Return the types to be declared before declaring index type. More... | |
static std::set< tree_nodeConstRef, TreeNodeConstSorter > | GetTypesToBeDeclaredAfter (const tree_nodeConstRef &tn, const bool without_transformation) |
Return the types to be declared after declaring index type. More... | |
static unsigned int | get_type_index (const tree_managerConstRef &TM, const unsigned int index, long long int &vec_size, bool &is_a_pointer, bool &is_a_function) |
Return the treenode index of the type of index. More... | |
static unsigned int | get_type_index (const tree_managerConstRef &TM, const unsigned int index) |
Same as previous but with two parameters. More... | |
static tree_nodeConstRef | GetFunctionReturnType (const tree_nodeConstRef &function, bool void_as_null=true) |
Return the return type of a function. More... | |
static unsigned int | get_pointed_type (const tree_managerConstRef &TM, const unsigned int index) |
Return the tree_node index of the pointed type of a pointer object;. More... | |
static tree_nodeConstRef | CGetPointedType (const tree_nodeConstRef &pointer) |
Return the pointed type of a pointer object. More... | |
static unsigned int | GetElements (const tree_managerConstRef &TM, const unsigned int index) |
Given an array or a vector return the element type. More... | |
static tree_nodeConstRef | CGetElements (const tree_nodeConstRef &type) |
Given an array or a vector return the element type. More... | |
static bool | IsSameType (const tree_nodeConstRef &tn0, const tree_nodeConstRef &tn1) |
Given two nodes tells if they have same base type (const is not considered: const double == double) More... | |
static std::string | get_type_name (const tree_managerConstRef &TM, const unsigned int index) |
Return name of the type. More... | |
static std::string | GetTypeName (const tree_nodeConstRef &type) |
Return name of the type. More... | |
static void | get_parameter_types (const tree_managerConstRef &TM, const unsigned int index, std::list< unsigned int > ¶ms) |
Return the tree node of parameter types. More... | |
static std::vector< tree_nodeConstRef > | GetParameterTypes (const tree_nodeConstRef &ftype) |
Return the tree node of parameter types. More... | |
static std::vector< tree_nodeConstRef > | CGetFieldTypes (const tree_nodeConstRef &type) |
Return the fields type of a variable of type struct. More... | |
static unsigned int | get_field_idx (const tree_managerConstRef &TM, const unsigned int index, unsigned int idx) |
Return the idx element of the fields declared in an union or a record type. More... | |
static tree_nodeRef | GetFieldIdx (const tree_nodeConstRef &type, unsigned int idx) |
Return the element of the fields declared in an union or a record type. More... | |
static tree_nodeConstRef | CGetType (const tree_nodeConstRef &node) |
Return the treenode of the type of node. More... | |
static bool | is_system (const tree_managerConstRef &TM, const unsigned int index) |
Return true if variable or type is a system one. More... | |
static bool | IsSystemType (const tree_nodeConstRef &type) |
Return true if variable or type is a system one. More... | |
static bool | IsInLibbambu (const tree_managerConstRef &TM, const unsigned int index) |
Return true if the decl node or type is in libbambu. More... | |
static bool | IsInLibbambu (const tree_nodeConstRef &type) |
Return true if the decl node or type is in libbambu. More... | |
static bool | is_an_enum (const tree_managerConstRef &TM, const unsigned int index) |
Return if treenode index is an enumeral type. More... | |
static bool | IsEnumType (const tree_nodeConstRef &type) |
Return if treenode index is an enumeral type. More... | |
static bool | is_a_struct (const tree_managerConstRef &TM, const unsigned int index) |
Return if treenode index is a record. More... | |
static bool | IsStructType (const tree_nodeConstRef &type) |
Return true if treenode is a record. More... | |
static bool | is_an_union (const tree_managerConstRef &TM, const unsigned int index) |
Return if treenode index is an union. More... | |
static bool | IsUnionType (const tree_nodeConstRef &type) |
Return if treenode is an union. More... | |
static bool | is_a_complex (const tree_managerConstRef &TM, const unsigned int index) |
Return if treenode index is a complex. More... | |
static bool | IsComplexType (const tree_nodeConstRef &type) |
Return if treenode is a complex. More... | |
static bool | is_an_array (const tree_managerConstRef &TM, const unsigned int index) |
Return if treenode index is an array or it is equivalent to an array (record recursively having a single field ending into a single arrays) More... | |
static bool | IsArrayEquivType (const tree_nodeConstRef &type) |
Return true if treenode is an array or it is equivalent to an array (record recursively having a single field ending into a single arrays) More... | |
static bool | IsArrayType (const tree_nodeConstRef &type) |
Return true if treenode is an array. More... | |
static tree_nodeConstRef | CGetArrayBaseType (const tree_nodeConstRef &type) |
static bool | is_a_pointer (const tree_managerConstRef &TM, const unsigned int index) |
Return if treenode index is a pointer. More... | |
static bool | IsPointerType (const tree_nodeConstRef &type) |
Return true if treenode index is a pointer. More... | |
static bool | is_a_function (const tree_managerConstRef &TM, const unsigned int index) |
Return if treenode index is a function_decl. More... | |
static bool | IsFunctionDeclaration (const tree_nodeConstRef &type) |
Return true if treenode is a function_decl. More... | |
static bool | is_a_vector (const tree_managerConstRef &TM, const unsigned int index) |
Return true if the treenode index is a vector. More... | |
static bool | IsVectorType (const tree_nodeConstRef &type) |
Return true if the treenode is a vector. More... | |
static bool | is_a_misaligned_vector (const tree_managerConstRef &TM, const unsigned int index) |
Return true if the treenode index is a a misaligned access to a vector data object. More... | |
static bool | is_an_addr_expr (const tree_managerConstRef &TM, const unsigned int index) |
Return if treenode index is an address expression. More... | |
static bool | HasToBeDeclared (const tree_managerConstRef &TM, const tree_nodeConstRef &type) |
Return true if the type has to be declared. More... | |
static bool | is_const_type (const tree_managerConstRef &TM, const unsigned int index) |
Return if the treenode is of const type. More... | |
static bool | IsConstType (const tree_nodeConstRef &type) |
Return true if the treenode is of const type. More... | |
static bool | is_bool (const tree_managerConstRef &TM, const unsigned int index) |
Return true if the treenode is of bool type. More... | |
static bool | IsBooleanType (const tree_nodeConstRef &type) |
Return true if the treenode is of bool type. More... | |
static bool | is_a_void (const tree_managerConstRef &TM, const unsigned int index) |
Return true if the treenode is of void type. More... | |
static bool | IsVoidType (const tree_nodeConstRef &type) |
Return true if the treenode is of void type. More... | |
static bool | is_natural (const tree_managerConstRef &TM, const unsigned int index) |
Return true if the treenode is a ssa_name greater or equal to zero. More... | |
static bool | IsPositiveIntegerValue (const tree_nodeConstRef &type) |
Return true if the treenode is a ssa_name greater or equal to zero. More... | |
static bool | is_int (const tree_managerConstRef &TM, const unsigned int index) |
Return true if the treenode is of integer type. More... | |
static bool | IsSignedIntegerType (const tree_nodeConstRef &type) |
Return true if the treenode is of integer type. More... | |
static bool | is_real (const tree_managerConstRef &TM, const unsigned int index) |
Return true if the treenode is of real type. More... | |
static bool | IsRealType (const tree_nodeConstRef &type) |
Return true if the treenode is of real type. More... | |
static bool | is_unsigned (const tree_managerConstRef &TM, const unsigned int index) |
Return true if the treenode is of unsigned integer type. More... | |
static bool | IsUnsignedIntegerType (const tree_nodeConstRef &type) |
Return true if the treenode is of unsigned integer type. More... | |
static bool | is_scalar (const tree_managerConstRef &TM, const unsigned int var) |
Return true if the treenode is an int, an unsigned, a real or a Boolean data type. More... | |
static bool | IsScalarType (const tree_nodeConstRef &type) |
Return true if the treenode is an int, an unsigned, a real or a Boolean data type. More... | |
static bool | is_a_variable (const tree_managerConstRef &TM, const unsigned int index) |
FIXME: to be remove after substitution with IsVariableType. More... | |
static bool | IsVariableType (const tree_nodeConstRef &node) |
Return true if the treenode is a valid variable. More... | |
static bool | is_static (const tree_managerConstRef &TM, const unsigned int index) |
FIXME: to be remove after substitution with IsStaticDeclaration. More... | |
static bool | IsStaticDeclaration (const tree_nodeConstRef &decl) |
static bool | is_extern (const tree_managerConstRef &TM, const unsigned int index) |
FIXME: to be remove after substitution with IsExternDeclaration. More... | |
static bool | IsExternDeclaration (const tree_nodeConstRef &decl) |
static bool | is_function_type (const tree_managerConstRef &TM, const unsigned int index) |
Return true if the treenode is of type function type. More... | |
static bool | IsFunctionType (const tree_nodeConstRef &type) |
Return true if the treenode is of type function type. More... | |
static bool | is_function_pointer_type (const tree_managerConstRef &TM, const unsigned int index) |
Return true if the treenode is of type function pointer type. More... | |
static bool | IsFunctionPointerType (const tree_nodeConstRef &type) |
Return true if the treenode is of type function pointer type. More... | |
static unsigned int | get_base_index (const tree_managerConstRef &TM, const unsigned int index) |
Retrun the base address of a memory access. More... | |
static tree_nodeConstRef | GetBaseVariable (const tree_nodeConstRef &mem) |
Retrun the base variable of a memory access. More... | |
static bool | is_fully_resolved (const tree_managerConstRef &TM, const unsigned int index, CustomOrderedSet< unsigned int > &res_set) |
FIXME: to be remove after substitution with IsPointerResolved. More... | |
static bool | IsPointerResolved (const tree_nodeConstRef &ptr, CustomOrderedSet< unsigned int > &res_set) |
static std::string | return_qualifier_prefix (const TreeVocabularyTokenTypes_TokenEnum quals) |
return the prefix given a qualifier More... | |
static std::string | return_C_qualifiers (const TreeVocabularyTokenTypes_TokenEnum quals, bool real_const) |
return the qualifiers in C format More... | |
static bool | is_ssa_name (const tree_managerConstRef &TM, const unsigned int index) |
Return true in case index is a ssa_name. More... | |
static bool | is_volatile (const tree_managerConstRef &TM, const unsigned int index) |
return true in case the index corresponds to a volatile variable More... | |
static bool | IsVolatile (const tree_nodeConstRef &tn) |
return true in case the tree node corresponds to a volatile variable More... | |
static bool | is_parameter (const tree_managerConstRef &TM, const unsigned int index) |
return true in case the index corresponds to a parameter in ssa form or not More... | |
static bool | is_virtual (const tree_managerConstRef &TM, const unsigned int index) |
return true in case the ssa_name is virtual More... | |
static integer_cst_t | get_integer_cst_value (const integer_cst *ic) |
Convert a integer_cst in a long long value. More... | |
static integer_cst_t | GetConstValue (const tree_nodeConstRef &tn, bool is_signed=true) |
Get value from integer constant. More... | |
static unsigned int | get_array_var (const tree_managerConstRef &TM, const unsigned int index, bool is_written, bool &two_dim_p) |
Return the tree node index of the array variable written or read. More... | |
static unsigned long long | get_array_data_bitsize (const tree_managerConstRef &TM, const unsigned int index) |
Return the size (in bits) of the base element of the array. More... | |
static unsigned long long | GetArrayElementSize (const tree_nodeConstRef &node) |
Return the size (in bits) of the base element of the array. More... | |
static void | get_array_dimensions (const tree_managerConstRef &TM, const unsigned int index, std::vector< unsigned long long > &dims) |
Return the dimension of the array. More... | |
static std::vector< unsigned long long > | GetArrayDimensions (const tree_nodeConstRef &node) |
Return the dimension of the array. More... | |
static void | get_array_dim_and_bitsize (const tree_managerConstRef &TM, const unsigned int index, std::vector< unsigned long long > &dims, unsigned long long &elts_bitsize) |
Return the dimension of the array. More... | |
static unsigned long long | get_array_num_elements (const tree_managerConstRef &TM, const unsigned int index) |
Return the total number of elements of the the base type in the array. More... | |
static unsigned long long | GetArrayTotalSize (const tree_nodeConstRef &node) |
Return the total number of elements of the the base type in the array. More... | |
static void | extract_array_indexes (const tree_managerConstRef &TM, const unsigned int index, std::vector< unsigned long long > &indexes, std::vector< unsigned long long > &size_indexes, unsigned int &base_object) |
Return the indexes of the array_ref. More... | |
static bool | is_concat_bit_ior_expr (const tree_managerConstRef &TM, const unsigned int index) |
check if a given tree node is a concatenation operation More... | |
static bool | is_simple_pointer_plus_test (const tree_managerConstRef &TM, const unsigned int index) |
check if a given tree node is a simple pointer plus expression More... | |
static bool | is_constant (const tree_managerConstRef &TM, const unsigned int index) |
Return if a tree node is a constant object. More... | |
static bool | IsConstant (const tree_nodeConstRef &node) |
Return if a tree node is a constant object. More... | |
static std::string | op_symbol (const tree_nodeConstRef &op) |
Function return the symbol related with the operator op passed as parameter. More... | |
static std::string | op_symbol (const tree_node *op) |
Function return the symbol related with the operator op passed as parameter. More... | |
static unsigned int | GetUnqualified (const tree_managerConstRef &TM, unsigned int type) |
Return the unqualified version of a type. More... | |
static tree_nodeConstRef | GetUnqualifiedType (const tree_nodeConstRef &type) |
Return the unqualified version of a type. More... | |
static unsigned int | GetRealType (const tree_managerConstRef &TM, unsigned int index) |
Return the real type. More... | |
static tree_nodeConstRef | GetRealType (const tree_nodeConstRef &type) |
Return the real type (same as GetUnqualifiedType, but return type instead of nullptr) More... | |
static bool | IsAligned (const tree_managerConstRef &TM, unsigned int type) |
Return true if type has not default alignment. More... | |
static bool | IsAligned (const tree_nodeConstRef &tn) |
static unsigned int | get_var_alignment (const tree_managerConstRef &TM, unsigned int var) |
Return the var alignment. More... | |
static std::string | NormalizeTypename (const std::string &id) |
Return normalized name of types and variables. More... | |
static std::string | GetMangledFunctionName (const function_decl *fd) |
Return the mangled function name. More... | |
static std::string | print_function_name (const tree_managerConstRef &TM, const function_decl *fd) |
Return the name of the function in a string. More... | |
static std::string | print_type (const tree_managerConstRef &TM, unsigned int type, bool global=false, bool print_qualifiers=false, bool print_storage=false, unsigned int var=0, const var_pp_functorConstRef &vppf=var_pp_functorConstRef(), const std::string &prefix="", const std::string &tail="") |
Print a type and its variable in case var is not zero. More... | |
static std::string | PrintType (const tree_managerConstRef &TM, const tree_nodeConstRef &type, bool global=false, bool print_qualifiers=false, bool print_storage=false, const tree_nodeConstRef &var=nullptr, const var_pp_functorConstRef &vppf=var_pp_functorConstRef(), const std::string &prefix="", const std::string &tail="") |
Print a type and its variable in case var is not zero. More... | |
static unsigned int | get_formal_ith (const tree_managerConstRef &TM, unsigned int index_obj, unsigned int parm_index) |
return the type of the ith formal parameter in case index_obj is a call_expr More... | |
static tree_nodeConstRef | GetFormalIth (const tree_nodeConstRef &obj, unsigned int parm_index) |
Return the type of the ith formal parameter in case index_obj is a call_expr. More... | |
static bool | is_packed (const tree_managerConstRef &TreeM, unsigned int node_index) |
FIXME: to be remove after substitution with IsPackedType. More... | |
static bool | IsPackedType (const tree_nodeConstRef &type) |
static bool | is_packed_access (const tree_managerConstRef &TreeM, unsigned int node_index) |
Check if the access is on a packed data structure or not. More... | |
static unsigned long long | AccessedMaximumBitsize (const tree_nodeConstRef &type_node, unsigned long long bitsize) |
return the maximum bitsize associated with the elements accessible through type_node More... | |
static unsigned long long | AccessedMinimunBitsize (const tree_nodeConstRef &type_node, unsigned long long bitsize) |
return the minimum bitsize associated with the elements accessible through type_node More... | |
static size_t | AllocatedMemorySize (const tree_nodeConstRef ¶meter) |
Compute the memory (in bytes) to be allocated to store a parameter or a variable. More... | |
static size_t | CountPointers (const tree_nodeConstRef &) |
Computes how many pointers are included in a tree node. More... | |
static unsigned int | get_multi_way_if_pos (const tree_managerConstRef &TM, unsigned int node_id, unsigned int cond) |
return the position of con in the gimple_multi_way_if conditions More... | |
static void | compute_ssa_uses_rec_ptr (const tree_nodeConstRef &tn, CustomOrderedSet< const ssa_name *> &ssa_uses) |
recursively compute the pointers to the ssa_name variables used in a statement More... | |
static TreeNodeMap< size_t > | ComputeSsaUses (const tree_nodeRef &tn) |
recursively compute the references to the ssa_name variables used in a statement More... | |
static bool | is_a_nop_function_decl (const function_decl *fd) |
static void | get_required_values (std::vector< std::tuple< unsigned int, unsigned int >> &required, const tree_nodeRef &tn) |
static bool | LastStatement (const tree_nodeConstRef &statement) |
Return true if statement must be the last of a basic block. More... | |
static size_t | GetFunctionSize (const tree_managerConstRef &TM, const unsigned int function_index) |
Return the number of statement + the number of phi in the function. More... | |
static std::string | get_asm_string (const tree_managerConstRef &TM, const unsigned int node_index) |
return the string associated with the gimple_asm More... | |
static bool | IsStore (const tree_nodeConstRef &tn, const CustomOrderedSet< unsigned int > &fun_mem_data) |
Return true if the tree node is a gimple_assign writing something which will be allocated in memory. More... | |
static bool | IsLoad (const tree_nodeConstRef &tn, const CustomOrderedSet< unsigned int > &fun_mem_data) |
Return true if the tree node is a gimple_assign reading something which will be allocated in memory. More... | |
static bool | IsLut (const tree_nodeConstRef &tn) |
Return true in case the right operation is a lut_expr. More... | |
static bool | has_omp_simd (const statement_list *sl) |
Check if omp simd pragmas are present in given statement list. More... | |
SystemC related functions | |
static bool | is_module (const tree_managerConstRef &TM, unsigned int index) |
This function test if a given index is a SystemC module. More... | |
static bool | is_channel (const tree_managerConstRef &TM, const unsigned int index) |
This function test if a given index is a SystemC channel. More... | |
static bool | is_builtin_channel (const tree_managerConstRef &TM, const unsigned int index) |
This function test if a given index is a SystemC builtin channel. More... | |
static bool | is_signal (const tree_managerConstRef &TM, const unsigned int index) |
This function test if a given index is a SystemC sc_signal. More... | |
static bool | is_port (const tree_managerConstRef &TM, const unsigned int index) |
This function test if a given index is a SystemC port. More... | |
static bool | is_in_port (const tree_managerConstRef &TM, const unsigned int index) |
This function test if a given index is a SystemC input port. More... | |
static bool | is_out_port (const tree_managerConstRef &TM, const unsigned int index) |
This function test if a given index is a SystemC output port. More... | |
static bool | is_inout_port (const tree_managerConstRef &TM, const unsigned int index) |
This function test if a given index is a SystemC in-output port. More... | |
static bool | is_event (const tree_managerConstRef &TM, const unsigned int index) |
This function test if a given index is a SystemC event. More... | |
static bool | is_clock (const tree_managerConstRef &TM, const unsigned int index) |
This function test if a given index as parm is a SystemC sc_clock. More... | |
static bool | is_SC_BIND_PROXY_NIL (const tree_managerConstRef &TM, const unsigned int index) |
This function test if a given index as parm is a SC_BIND_PROXY_NIL. More... | |
Static Public Attributes | |
static int | debug_level = 0 |
debug level (set by Parameter) More... | |
Static Private Member Functions | |
static void | RecursiveGetTypesToBeDeclared (std::set< tree_nodeConstRef, TreeNodeConstSorter > &returned_types, const tree_nodeConstRef &type, const bool recursion, const bool without_transformation, const bool before) |
Return the types to be declared before/after declaring type. More... | |
static void | ComputeSsaUses (const tree_nodeRef &, TreeNodeMap< size_t > &uses) |
recursively compute the references to the ssa_name variables used in a statement More... | |
Static Private Attributes | |
static const std::set< std::string > | SC_tmpl_class |
store the set of SystemC class for which the type correspond to the template parameter More... | |
static const std::set< std::string > | SC_builtin_scalar_type |
store the set of SystemC class for which the template parameter correspond to the bit size of the type More... | |
static const std::set< std::string > | TLM_SC_builtin_scalar_type |
store the set of TLM SystemC class for which the size corresponds to the sum of the size of template parameters More... | |
This class collects some utility functions used to extract information from tree-based data structures.
Definition at line 78 of file tree_helper.hpp.
|
default |
Constructor.
|
default |
Destructor.
|
static |
return the maximum bitsize associated with the elements accessible through type_node
it is composed by two identical parts
Definition at line 6668 of file tree_helper.cpp.
References CASE_BINARY_EXPRESSION, CASE_CPP_NODES, CASE_CST_NODES, CASE_FAKE_NODES, CASE_GIMPLE_NODES, CASE_PRAGMA_NODES, CASE_QUATERNARY_EXPRESSION, CASE_TERNARY_EXPRESSION, CASE_UNARY_EXPRESSION, CGetType(), GET_CONST_NODE, tree_node::get_kind(), tree_node::get_kind_text(), tree_node::index, max, Size(), STR, THROW_ERROR, test_panda::type, and type_node.
Referenced by memory_allocation::finalize_memory_allocation(), AllocationInformation::get_correction_time(), mem_dominator_allocation::InternalExec(), and fu_binding::specialise_fu().
|
static |
return the minimum bitsize associated with the elements accessible through type_node
it is composed by two identical parts
Definition at line 6799 of file tree_helper.cpp.
References CASE_BINARY_EXPRESSION, CASE_CPP_NODES, CASE_CST_NODES, CASE_FAKE_NODES, CASE_GIMPLE_NODES, CASE_PRAGMA_NODES, CASE_QUATERNARY_EXPRESSION, CASE_TERNARY_EXPRESSION, CASE_UNARY_EXPRESSION, CGetType(), GET_CONST_NODE, tree_node::get_kind(), tree_node::get_kind_text(), min, Size(), THROW_ERROR, test_panda::type, and type_node.
Referenced by mem_dominator_allocation::InternalExec().
|
static |
Compute the memory (in bytes) to be allocated to store a parameter or a variable.
parameter | is the actual parameter |
Note that this part can not be transfromed in recursion because size of array ref corresponds to the size of the element itself
This call check if we can perform deep copy of the single element
Round to upper multiple word size
This calls check if we can perform deep copy of the single element
Round to upper multiple word size
Round to upper multiple word size
Definition at line 6927 of file tree_helper.cpp.
References CASE_CPP_NODES, CASE_FAKE_NODES, CASE_GIMPLE_NODES, CASE_PRAGMA_NODES, CASE_QUATERNARY_EXPRESSION, CASE_TYPE_NODES, CASE_UNARY_EXPRESSION, CGetPointedType(), CGetType(), debug_level, DEBUG_LEVEL_PARANOIC, GET_CONST_NODE, tree_node::get_kind(), tree_node::get_kind_text(), GET_NODE, INDENT_DBG_MEX, IsPointerType(), Size(), STR, THROW_ERROR, THROW_UNREACHABLE, and tree_node::ToString().
|
static |
type | is the treenode |
Definition at line 2470 of file tree_helper.cpp.
References CGetType(), getBuiltinFieldTypes(), and THROW_ASSERT.
Referenced by InterfaceInfer::interface_info::update().
|
static |
Given an array or a vector return the element type.
type | is the type of the array |
Definition at line 1733 of file tree_helper.cpp.
References GET_CONST_NODE, tree_node::get_kind(), THROW_UNREACHABLE, and test_panda::type.
Referenced by tree_manipulation::create_binary_operation(), fu_binding::fill_array_ref_memory(), GetElements(), BehavioralHelper::GetElements(), AllocationInformation::GetNodeTypePrec(), MemoryInitializationWriterBase::GoDown(), rebuild_initialization::InternalExec(), compute_implicit_calls::InternalExec(), IR_lowering::InternalExec(), allocation::InternalExec(), rebuild_initialization2::look_for_ROMs(), BehavioralHelper::PrintNode(), RecursiveGetTypesToBeDeclared(), fu_binding::specialise_fu(), HLSCWriter::WriteMainTestbench(), and DiscrepancyAnalysisCWriter::writePostInstructionInfo().
|
static |
Return the fields type of a variable of type struct.
type | is the struct type |
Definition at line 2106 of file tree_helper.cpp.
References CGetType(), GET_CONST_NODE, THROW_UNREACHABLE, and test_panda::type.
Referenced by MemoryInitializationWriterBase::GoDown(), MemoryInitializationWriterBase::GoNext(), MemoryInitializationWriterBase::GoUp(), and RecursiveGetTypesToBeDeclared().
|
static |
Return the pointed type of a pointer object.
pointer | is the pointer object |
Definition at line 1649 of file tree_helper.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_UNARY_EXPRESSION, GET_CONST_NODE, tree_node::get_kind(), STR, and THROW_UNREACHABLE.
Referenced by AllocatedMemorySize(), minimal_interface::build_wrapper(), CreateAddressTranslation::ComputeAddress(), InterfaceInfer::Exec(), BehavioralHelper::get_pointed_type(), ComputeReservedMemory::GetReservedBytes(), MemoryInitializationWriterBase::GoDown(), soft_float_cg_ext::int_type_for(), BuiltinWaitCallModuleGenerator::InternalExec(), BuiltinWaitCallNModuleGenerator::InternalExec(), soft_float_cg_ext::lowering_needed(), BehavioralHelper::PrintNode(), MemoryInitializationWriter::Process(), soft_float_cg_ext::RecursiveExaminate(), RecursiveGetTypesToBeDeclared(), soft_float_cg_ext::signature_lowering(), HLSCWriter::WriteMainTestbench(), and HLSCWriter::WriteParamInitialization().
|
static |
Return the treenode of the type of node.
node | is the treenode |
Definition at line 2167 of file tree_helper.cpp.
References CASE_BINARY_EXPRESSION, CASE_CPP_NODES, CASE_DECL_NODES, CASE_FAKE_NODES, CASE_PRAGMA_NODES, CASE_QUATERNARY_EXPRESSION, CASE_TERNARY_EXPRESSION, CASE_TYPE_NODES, CASE_UNARY_EXPRESSION, GET_CONST_NODE, tree_node::get_kind(), NODE_NOT_YET_SUPPORTED_EC, THROW_ASSERT, and THROW_ERROR_CODE.
Referenced by AccessedMaximumBitsize(), AccessedMinimunBitsize(), fu_binding::add_to_SM(), memory_allocation::allocate_parameters(), AllocatedMemorySize(), determine_memory_accesses::analyze_node(), CBackend::AnalyzeInclude(), PhiOpt::ApplyIfMerge(), PhiOpt::ApplyIfRemove(), PhiOpt::ApplyMultiMerge(), PhiOpt::ApplyMultiRemove(), IR_lowering::array_ref_lowering(), Bit_Value::backward(), Bit_Value::backward_chain(), operations_cfg_computation::build_operation_recursive(), minimal_interface::build_wrapper(), HWCallInjection::buildBuiltinCall(), AllocationInformation::can_be_asynchronous_ram(), CGetArrayBaseType(), CGetFieldTypes(), InterfaceInfer::ChasePointerInterfaceRecurse(), lut_transformation::CHECK_BIN_EXPR_BOOL_SIZE(), lut_transformation::CHECK_BIN_EXPR_INT_SIZE(), lut_transformation::CHECK_COND_EXPR_SIZE(), lut_transformation::CHECK_NOT_EXPR_SIZE(), simple_code_motion::CheckMovable(), Vectorize::ClassifyTreeNode(), memory::compute_next_base_address(), CreateAddressTranslation::ComputeAddress(), CountPointers(), mux_connection_binding::create_connections(), tree_manipulation::create_gimple_call(), short_circuit_taf::create_gimple_cond(), tree_manipulation::create_gimple_cond(), tree_manipulation::create_gimple_modify_stmt(), tree_manipulation::create_phi_node(), tree_manipulation::create_ternary_operation(), tree_manipulation::CreateAddrExpr(), tree_manipulation::CreateCallExpr(), CWriter::DeclareVariable(), vcd_utility::detect_fixed_address_mismatch(), mux_connection_binding::determine_connection(), IR_lowering::division_by_a_constant(), BitValueIPA::Exec(), CreateAddressTranslation::Exec(), InterfaceInfer::Exec(), IR_lowering::expand_mult_const(), tree_manipulation::ExtractCondition(), fu_binding::fill_array_ref_memory(), memory_allocation::finalize_memory_allocation(), Vectorize::FixPhis(), Bit_Value::forward(), Bit_Value::forward_transfer(), TestbenchGeneration::generate_init_file(), soft_float_cg_ext::generate_interface(), get_array_dim_and_bitsize(), HLS_manager::get_constant_string(), AllocationInformation::get_correction_time(), get_type_index(), get_type_name(), GetArrayElementSize(), getBuiltinFieldTypes(), AllocationInformation::GetCondExprTimeLatency(), GetFormalIth(), AllocationInformation::GetNodeTypePrec(), GetParameterTypes(), ComputeReservedMemory::GetReservedBytes(), GimpleWriter::GimpleWriter(), CSE::has_memory_access(), CSE::hash_check(), PhiOpt::IdentifyPattern(), BitLatticeManipulator::inf(), Bit_Value::initialize(), parm_decl_taken_address_fix::InternalExec(), FixStructsPassedByValue::InternalExec(), BuiltinWaitCallModuleGenerator::InternalExec(), BuiltinWaitCallNModuleGenerator::InternalExec(), SerializeMutualExclusions::InternalExec(), SwitchFix::InternalExec(), extract_patterns::InternalExec(), BuildVirtualPhi::InternalExec(), mem_dominator_allocation::InternalExec(), rebuild_initialization::InternalExec(), fanout_opt::InternalExec(), compute_implicit_calls::InternalExec(), FunctionCallTypeCleanup::InternalExec(), CondExprRestructuring::InternalExec(), commutative_expr_restructuring::InternalExec(), dead_code_elimination::InternalExec(), CSE::InternalExec(), MultipleEntryIfReduction::InternalExec(), IR_lowering::InternalExec(), soft_float_cg_ext::InternalExec(), allocation::InternalExec(), is_a_misaligned_vector(), BehavioralHelper::is_named_pointer(), IsArrayEquivType(), IsArrayType(), IsBooleanType(), commutative_expr_restructuring::IsCommExprGimple(), IsComplexType(), IsConstType(), IsEnumType(), IsFunctionPointerType(), IsFunctionType(), BitLatticeManipulator::IsHandledByBitvalue(), IsLoad(), IsPointerType(), IsRealType(), IsSameType(), IsSignedIntegerType(), IsStore(), IsStructType(), IsUnionType(), IsUnsignedIntegerType(), IsVectorType(), IsVoidType(), IsVolatile(), dead_code_elimination::kill_uses(), rebuild_initialization2::look_for_ROMs(), MemoryInitializationWriterBase::MemoryInitializationWriterBase(), mux_connection_binding::object_bitsize(), type_casting::operator()(), Bit_Value_opt::optimize(), FunctionCallTypeCleanup::ParametersTypeCleanup(), vcd_utility::print_discrepancy(), BehavioralHelper::print_type_declaration(), TestbenchGeneration::print_var_init(), BehavioralHelper::PrintNode(), PrintType(), BehavioralHelper::PrintVarDeclaration(), lut_transformation::ProcessBasicBlock(), hls_div_cg_ext::recursive_examinate(), soft_float_cg_ext::RecursiveExaminate(), VarComputation::RecursivelyAnalyze(), compute_implicit_calls::replace_with_memcpy(), compute_implicit_calls::replace_with_memset(), InterfaceInfer::setReadInterface(), InterfaceInfer::setWriteInterface(), dead_code_eliminationIPA::signature_opt(), VcdSignalSelection::SingleStepPropagateAddrSsa(), Size(), fu_binding::specialise_fu(), BitLatticeManipulator::sup(), Vectorize::Transform(), InterfaceInfer::interface_info::update(), virtual_phi_nodes_split::virtual_split_phi(), fu_binding::write_init(), CWriter::WriteBuiltinWaitCall(), CBackend::writeIncludes(), HLSCWriter::WriteMainTestbench(), HLSCWriter::WriteParamDecl(), HLSCWriter::WriteParamInitialization(), and DiscrepancyAnalysisCWriter::writePostInstructionInfo().
|
static |
recursively compute the pointers to the ssa_name variables used in a statement
tn | is the statement |
ssa_uses | is the collection of ssa_name tn uses |
var decl performs an assignment when init is not null
step and offset are constants
step and offset are constants
Definition at line 7519 of file tree_helper.cpp.
References test_panda::arg, CASE_BINARY_EXPRESSION, CASE_CPP_NODES, CASE_PRAGMA_NODES, CASE_QUATERNARY_EXPRESSION, CASE_TERNARY_EXPRESSION, CASE_TYPE_NODES, CASE_UNARY_EXPRESSION, debug_level, DEBUG_LEVEL_PARANOIC, GET_CONST_NODE, tree_node::get_kind(), tree_node::get_kind_text(), GET_NODE, INDENT_DBG_MEX, THROW_UNREACHABLE, and tree_node::ToString().
Referenced by Schedule::CanBeMoved(), simple_code_motion::CheckMovable(), Schedule::ComputeCriticalPath(), simple_code_motion::InternalExec(), and Schedule::UpdateTime().
|
staticprivate |
recursively compute the references to the ssa_name variables used in a statement
tn | is the statement |
uses | is where the uses will be stored |
var decl performs an assignment when init is not null
step and offset are constants
step and offset are constants
Definition at line 7855 of file tree_helper.cpp.
References test_panda::arg, CASE_BINARY_EXPRESSION, CASE_CPP_NODES, CASE_FAKE_NODES, CASE_PRAGMA_NODES, CASE_QUATERNARY_EXPRESSION, CASE_TERNARY_EXPRESSION, CASE_TYPE_NODES, CASE_UNARY_EXPRESSION, debug_level, DEBUG_LEVEL_PARANOIC, GET_CONST_NODE, GET_INDEX_CONST_NODE, tree_node::get_kind(), GET_NODE, INDENT_DBG_MEX, STR, THROW_ASSERT, and THROW_UNREACHABLE.
Referenced by tree_manager::check_ssa_uses(), ComputeSsaUses(), AllocationInformation::GetConnectionTime(), tree_manipulation::InlineFunctionCall(), use_counting::InternalExec(), NI_SSA_liveness::InternalExec(), MultipleEntryIfReduction::InternalExec(), VcdSignalSelection::PropagateAddrParamToSsa(), tree_manager::RecursiveReplaceTreeNode(), bloc::RemovePhi(), bloc::RemoveStmt(), bloc::ReorderLUTs(), and bloc::update_new_stmt().
|
static |
recursively compute the references to the ssa_name variables used in a statement
tn | is the statement |
Definition at line 7848 of file tree_helper.cpp.
References ComputeSsaUses().
|
static |
Computes how many pointers are included in a tree node.
tn | is the tree ndoe to be considered |
Definition at line 7399 of file tree_helper.cpp.
References CASE_BINARY_EXPRESSION, CASE_CPP_NODES, CASE_CST_NODES, CASE_FAKE_NODES, CASE_GIMPLE_NODES, CASE_PRAGMA_NODES, CASE_QUATERNARY_EXPRESSION, CASE_TERNARY_EXPRESSION, CASE_UNARY_EXPRESSION, CGetType(), counter, GET_CONST_NODE, tree_node::get_kind(), GET_NODE, and THROW_UNREACHABLE.
|
static |
Return the indexes of the array_ref.
TM | is the tree_manager |
index | is the array_ref object |
indexes | return the index of the array_ref |
size_indexes | return the size of each index |
base_object | is the base referenced object |
Definition at line 5047 of file tree_helper.cpp.
References tree_manager::CGetTreeNode(), GET_CONST_NODE, GET_INDEX_CONST_NODE, GetConstValue(), STR, and THROW_ASSERT.
|
static |
Given the tree_node of an obj_type_ref return the tree_node of the called function.
tn | is the tree node of the obj_type_ref. |
Definition at line 983 of file tree_helper.cpp.
References GET_CONST_NODE, GET_INDEX_CONST_NODE, GET_NODE, reference_type::refd, STR, THROW_ASSERT, THROW_ERROR, test_panda::type, and decl_node::type.
Referenced by operations_cfg_computation::build_operation_recursive(), CallGraphManager::call_graph_computation_recursive(), get_required_values(), dead_code_elimination::InternalExec(), and BehavioralHelper::PrintNode().
|
static |
Return the size (in bits) of the base element of the array.
TM | is the tree_manager |
index | is the array objectFIXME: to be remove after substitution with GetArrayElementSize |
Definition at line 4875 of file tree_helper.cpp.
References tree_manager::CGetTreeReindex(), and GetArrayElementSize().
Referenced by get_array_dim_and_bitsize().
|
static |
Return the dimension of the array.
TM | is the tree_manager |
index | is the array object |
dims | return for each dimension the number of elements |
elts_bitsize | return the base type bitsizeFIXME: to be remove after substitution with GetArrayDimensions and GetArrayElementSize |
Definition at line 4923 of file tree_helper.cpp.
References CGetType(), get_array_data_bitsize(), GET_CONST_NODE, GET_INDEX_CONST_NODE, tree_node::get_kind(), GET_NODE, tree_manager::get_tree_node_const(), GetConstValue(), max, Size(), STR, and THROW_ASSERT.
Referenced by AllocationInformation::can_be_asynchronous_ram(), BitLatticeManipulator::constructor_bitstring(), constructor_range(), fu_binding::fill_array_ref_memory(), rebuild_initialization2::look_for_ROMs(), and fu_binding::write_init().
|
static |
Return the dimension of the array.
TM | is the tree_manager |
index | is the array object |
dims | return for each dimension the number of elementsFIXME: to be remove after substitution with GetArrayDimensions |
Definition at line 4976 of file tree_helper.cpp.
References tree_manager::CGetTreeReindex(), and GetArrayDimensions().
Referenced by AllocationInformation::get_correction_time().
|
static |
Return the total number of elements of the the base type in the array.
TM | is the tree_manager |
index | is the array objectFIXME: to be remove after substitution with GetArrayTotalSize |
Definition at line 5031 of file tree_helper.cpp.
References tree_manager::CGetTreeReindex(), and GetArrayTotalSize().
|
static |
Return the tree node index of the array variable written or read.
TM | is the tree_manager |
index | is the index of the gimple_assign |
is_written | is true when the array is written false otherwise |
two_dim_p | becomes true when the array is two dimensional |
Definition at line 4377 of file tree_helper.cpp.
References target_mem_ref::base, target_mem_ref461::base, GET_INDEX_CONST_NODE, GET_NODE, tree_manager::get_tree_node_const(), STR, target_mem_ref::symbol, THROW_ASSERT, and THROW_ERROR.
|
static |
return the string associated with the gimple_asm
TM | is the tree manager |
node_index | is the gimple_asm node id |
Definition at line 8790 of file tree_helper.cpp.
References tree_manager::get_tree_node_const(), and THROW_ASSERT.
Referenced by BehavioralHelper::get_asm_string().
|
static |
Retrun the base address of a memory access.
TM | is the tree manager |
int | is the index of the accessFIXME: to be remove after substitution with GetBaseVariable |
Definition at line 3333 of file tree_helper.cpp.
References tree_manager::CGetTreeReindex(), GET_INDEX_CONST_NODE, and GetBaseVariable().
Referenced by vcd_utility::detect_address_mismatch(), VcdSignalSelection::Exec(), Bit_Value::initialize(), IR_lowering::InternalExec(), LoadOpNode::opCtorGenerator(), and Bit_Value::pointer_resizing().
|
static |
Return the idx element of the fields declared in an union or a record type.
TM | is the tree_manager |
ind | is the index of the record/union type |
idx | is the index of the field declFIXME: to be remove after substitution with GetFieldIdx |
Definition at line 2141 of file tree_helper.cpp.
References tree_manager::CGetTreeReindex(), GetFieldIdx(), and tree_node::index.
|
static |
return the type of the ith formal parameter in case index_obj is a call_expr
FIXME: to be remove after substitution with GetFormalIth
Definition at line 6284 of file tree_helper.cpp.
References tree_manager::CGetTreeReindex(), GetFormalIth(), and tree_node::index.
|
static |
Convert a integer_cst in a long long value.
ic | is the integer costant data.FIXME: to be remove after substitution with GetConstValue |
Definition at line 4343 of file tree_helper.cpp.
References debug_level, DEBUG_LEVEL_PARANOIC, GET_CONST_NODE, GET_INDEX_CONST_NODE, INDENT_DBG_MEX, STR, THROW_ASSERT, test_panda::type, cst_node::type, and integer_cst::value.
Referenced by evaluateBranch(), IR_lowering::expand_MC(), GimpleWriter::GimpleWriter(), and fu_binding::specialise_fu().
|
static |
return the position of con in the gimple_multi_way_if conditions
TM | is the tree manager |
node_id | is the node id of the gimple_multi_way_if node |
cond | is the condition index |
Definition at line 7501 of file tree_helper.cpp.
References tree_manager::CGetTreeNode(), STR, and THROW_ERROR.
Referenced by fsm_controller::get_guard_value().
|
static |
Return the tree node of parameter types.
TM | is the tree_manager |
ind | is the index of the function type |
params | is where parameter types are storedFIXME: to be remove after substitution with GetParameterTypes |
Definition at line 2057 of file tree_helper.cpp.
References tree_manager::CGetTreeReindex(), and GetParameterTypes().
|
static |
Return the tree_node index of the pointed type of a pointer object;.
TM | is the tree_manager |
index | is the index of the pointer objectFIXME: to be remove after substitution with GetPointedType/CGetPointedType |
Definition at line 1559 of file tree_helper.cpp.
References CASE_BINARY_EXPRESSION, CASE_CPP_NODES, CASE_CST_NODES, CASE_FAKE_NODES, CASE_GIMPLE_NODES, CASE_PRAGMA_NODES, CASE_QUATERNARY_EXPRESSION, CASE_TERNARY_EXPRESSION, CASE_UNARY_EXPRESSION, tree_manager::CGetTreeNode(), GET_INDEX_CONST_NODE, STR, and THROW_ASSERT.
|
static |
this has not to be synthesized
bpos has an offset in bits
Definition at line 8272 of file tree_helper.cpp.
References test_panda::arg, CASE_BINARY_EXPRESSION, CASE_CPP_NODES, CASE_FAKE_NODES, CASE_PRAGMA_NODES, CASE_TERNARY_EXPRESSION, CASE_TYPE_NODES, CASE_UNARY_EXPRESSION, find_obj_type_ref_function(), GET_CONST_NODE, GET_INDEX_CONST_NODE, tree_node::get_kind(), GET_NODE, GetConstValue(), is_a_nop_function_decl(), IsVectorType(), STR, THROW_ASSERT, THROW_ERROR, and THROW_UNREACHABLE.
Referenced by Bit_Value::backward(), Bit_Value::forward(), HLS_manager::get_required_values(), and Bit_Value::initialize().
|
static |
Return the treenode index of the type of index.
TM | is the tree_manager |
index | is the treenode index |
vec_size | in case the treenode is a vector return its size |
is_a_pointer | in case the treenode is a pointer return true |
is_a_function | in case the treenode is a function_decl return trueFIXME: to be remove after substitution with GetType/CGetType and others to get the out variable checks |
Definition at line 1426 of file tree_helper.cpp.
References tree_manager::CGetTreeReindex(), CGetType(), GET_CONST_NODE, STR, and THROW_ASSERT.
Referenced by CWriter::compute_phi_nodes(), VcdSignalSelection::DetectInvalidReturns(), VcdSignalSelection::Exec(), IR_lowering::expand_target_mem_ref(), AllocationInformation::get_correction_time(), BehavioralHelper::get_type(), get_type_index(), VcdSignalSelection::InitialSsaIsAddress(), IR_lowering::InternalExec(), VcdSignalSelection::SelectInitialAddrParam(), and VcdSignalSelection::SelectInitialSsa().
|
static |
Same as previous but with two parameters.
TM | is the tree_manager |
index | is the treenodeFIXME: to be remove after substitution with GetType/CGetType |
Definition at line 2098 of file tree_helper.cpp.
References get_type_index(), is_a_function(), and is_a_pointer().
|
static |
Return name of the type.
TM | is the tree manager |
index | is the index of the type |
Definition at line 1750 of file tree_helper.cpp.
References tree_manager::CGetTreeReindex(), CGetType(), GET_CONST_NODE, STR, THROW_ASSERT, and test_panda::type.
Referenced by tree_manager::check_for_decl(), and tree_manager::check_for_type().
|
static |
Return the list of tree nodes associated with the variable used by the node t.
first_level_only | tells if we are performing inlining |
t | is a tree node (usually a function declaration). |
list_of_variable | list of used variables. |
Definition at line 620 of file tree_helper.cpp.
References test_panda::arg, CASE_BINARY_EXPRESSION, CASE_CPP_NODES, CASE_FAKE_NODES, CASE_PRAGMA_NODES, CASE_QUATERNARY_EXPRESSION, CASE_TERNARY_EXPRESSION, CASE_TYPE_NODES, CASE_UNARY_EXPRESSION, GET_CONST_NODE, GET_INDEX_CONST_NODE, tree_node::get_kind(), sl, THROW_ASSERT, and THROW_ERROR.
Referenced by BehavioralHelper::GetInit().
|
static |
Return the var alignment.
TM | is the tree manager |
index | is the index of the variable |
Definition at line 5109 of file tree_helper.cpp.
References tree_manager::CGetTreeNode().
Referenced by memory::add_external_variable(), and memory::add_internal_variable().
|
static |
Return the dimension of the array.
node | is the array object |
Definition at line 4983 of file tree_helper.cpp.
References GET_CONST_NODE, tree_node::get_kind(), GetArrayElementSize(), GetConstValue(), Size(), STR, and THROW_ASSERT.
Referenced by IR_lowering::array_ref_lowering(), get_array_dimensions(), AllocationInformation::get_correction_time(), GetArrayTotalSize(), and MemoryInitializationWriterBase::GoUp().
|
static |
Return the size (in bits) of the base element of the array.
node | is the array object |
Definition at line 4881 of file tree_helper.cpp.
References CGetType(), GET_CONST_NODE, tree_node::get_kind(), max, Size(), THROW_ASSERT, and test_panda::type.
Referenced by IR_lowering::array_ref_lowering(), get_array_data_bitsize(), GetArrayDimensions(), mem_dominator_allocation::InternalExec(), and TestbenchGeneration::print_var_init().
|
static |
Return the total number of elements of the the base type in the array.
node | is the array object |
Definition at line 5037 of file tree_helper.cpp.
References GetArrayDimensions().
Referenced by InterfaceInfer::Exec(), get_array_num_elements(), TestbenchGeneration::print_var_init(), and HLSCWriter::WriteMainTestbench().
|
static |
Retrun the base variable of a memory access.
mem | is the node of the memory access |
Definition at line 3340 of file tree_helper.cpp.
References CASE_BINARY_EXPRESSION, CASE_CPP_NODES, CASE_FAKE_NODES, CASE_GIMPLE_NODES, CASE_PRAGMA_NODES, CASE_QUATERNARY_EXPRESSION, CASE_TERNARY_EXPRESSION, CASE_TYPE_NODES, CASE_UNARY_EXPRESSION, check_for_simple_pointer_arithmetic(), GET_CONST_NODE, tree_node::get_kind(), tree_node::get_kind_text(), GET_NODE, GetConstValue(), NODE_NOT_YET_SUPPORTED_EC, STR, THROW_ASSERT, THROW_ERROR, and THROW_ERROR_CODE.
Referenced by determine_memory_accesses::analyze_node(), InterfaceInfer::ChasePointerInterfaceRecurse(), mux_connection_binding::determine_connection(), memory_allocation::finalize_memory_allocation(), get_base_index(), mem_dominator_allocation::InternalExec(), compute_implicit_calls::InternalExec(), allocation::InternalExec(), ResolvePointerAlias(), InterfaceInfer::setReadInterface(), InterfaceInfer::setWriteInterface(), and fu_binding::specialise_fu().
|
static |
Get value from integer constant.
tn | Integer constant tree node |
is_signed | Return signed value if true, unsigned equivalent if false |
Definition at line 4358 of file tree_helper.cpp.
References debug_level, DEBUG_LEVEL_PARANOIC, GET_CONST_NODE, tree_node::get_kind(), INDENT_DBG_MEX, Size(), STR, and THROW_ASSERT.
Referenced by Bit_Value::backward_transfer(), lut_transformation::CHECK_BIN_EXPR_INT_SIZE(), simple_code_motion::CheckMovable(), Vectorize::ClassifyTreeNode(), CreateAddressTranslation::ComputeAddress(), BitLatticeManipulator::constructor_bitstring(), mux_connection_binding::create_connections(), tree_manipulation::CreateUnsigned(), Nuutila::delControlDependenceEdges(), mux_connection_binding::determine_connection(), IR_lowering::division_by_a_constant(), evaluateBranch(), BitValueIPA::Exec(), IR_lowering::expand_target_mem_ref(), extract_array_indexes(), rebuild_initialization2::extract_var_decl(), rebuild_initialization2::extract_var_decl_ppe(), tree_manipulation::ExtractCondition(), Bit_Value::forward_transfer(), get_array_dim_and_bitsize(), PragmaAnalysis::get_call_parameter(), HLS_manager::get_constant_string(), fsm_controller::get_guard_value(), get_required_values(), GetArrayDimensions(), GetBaseVariable(), GetTypeName(), GimpleWriter::GimpleWriter(), Bit_Value::initialize(), BuiltinWaitCallModuleGenerator::InternalExec(), BuiltinWaitCallNModuleGenerator::InternalExec(), SwitchFix::InternalExec(), LoopsAnalysisBambu::InternalExec(), mem_dominator_allocation::InternalExec(), rebuild_initialization::InternalExec(), simple_code_motion::InternalExec(), dead_code_elimination::InternalExec(), CSE::InternalExec(), IR_lowering::InternalExec(), IsPositiveIntegerValue(), rebuild_initialization2::look_for_ROMs(), field_decl::offset(), op_symbol(), Bit_Value_opt::optimize(), VarNode::print(), BehavioralHelper::print_type_declaration(), BehavioralHelper::PrintConstant(), PhiOpNode::printDot(), UnaryOpNode::printDot(), SigmaOpNode::printDot(), BinaryOpNode::printDot(), TernaryOpNode::printDot(), LoadOpNode::printDot(), BehavioralHelper::PrintNode(), PrintType(), BehavioralHelper::PrintVariable(), lut_transformation::ProcessBasicBlock(), hls_div_cg_ext::recursive_examinate(), compute_implicit_calls::replace_with_memcpy(), compute_implicit_calls::replace_with_memset(), Size(), BitLatticeManipulator::Size(), fu_binding::specialise_fu(), Vectorize::Transform(), and fu_binding::write_init().
|
static |
Given an array or a vector return the element type.
TM | is the tree_manager |
index | is the type of the array |
Definition at line 1728 of file tree_helper.cpp.
References CGetElements(), and tree_manager::CGetTreeReindex().
Referenced by VcdSignalSelection::IsAddressType().
|
static |
Return the element of the fields declared in an union or a record type.
type | is the record/union type |
idx | is the index of the field decl |
Definition at line 2147 of file tree_helper.cpp.
References THROW_ASSERT, THROW_ERROR, and test_panda::type.
Referenced by get_field_idx().
|
static |
Return the type of the ith formal parameter in case index_obj is a call_expr.
obj | is the call_expr node |
parm_index | is the index of the parameter |
parameters are not available through function_type but only through function_decl
parameters are not available through function_type but only through function_decl
Definition at line 6157 of file tree_helper.cpp.
References CGetType(), GET_CONST_NODE, tree_node::get_kind(), THROW_ASSERT, and THROW_ERROR.
Referenced by mux_connection_binding::create_connections(), get_formal_ith(), AllocationInformation::GetNodeTypePrec(), FixStructsPassedByValue::InternalExec(), FunctionCallTypeCleanup::ParametersTypeCleanup(), compute_implicit_calls::replace_with_memcpy(), and compute_implicit_calls::replace_with_memset().
|
static |
Return the name of the function.
TM | is the tree manager instance |
decl | is the treenode of the class (of a function_decl) |
Definition at line 423 of file tree_helper.cpp.
References GET_CONST_NODE, tree_node::get_kind(), tree_node::get_kind_text(), print_function_name(), and THROW_ERROR.
Referenced by InterfaceInfer::Exec(), hls_div_cg_ext::InternalExec(), name_function(), and tree_manipulation::VersionFunctionCall().
|
static |
Return the return type of a function.
function | is the function to be considered |
void_as_null | if true returns nullptr when return type is void, else return tree node for void type |
Definition at line 1461 of file tree_helper.cpp.
References CASE_BINARY_EXPRESSION, CASE_CPP_NODES, CASE_CST_NODES, CASE_FAKE_NODES, CASE_GIMPLE_NODES, CASE_PRAGMA_NODES, CASE_QUATERNARY_EXPRESSION, CASE_TERNARY_EXPRESSION, CASE_UNARY_EXPRESSION, GET_CONST_NODE, tree_node::get_kind(), THROW_ASSERT, and THROW_UNREACHABLE.
Referenced by CWriter::DeclareFunctionTypes(), BitValueIPA::Exec(), TestbenchGeneration::Exec(), memory_allocation::finalize_memory_allocation(), soft_float_cg_ext::generate_interface(), BehavioralHelper::GetFunctionReturnType(), Bit_Value::initialize(), TestbenchAxisModuleGenerator::InternalExec(), BuiltinWaitCallModuleGenerator::InternalExec(), BuiltinWaitCallNModuleGenerator::InternalExec(), SplitReturn::InternalExec(), FunctionCallTypeCleanup::InternalExec(), IR_lowering::InternalExec(), BehavioralHelper::PrintNode(), RecursiveGetTypesToBeDeclared(), dead_code_eliminationIPA::signature_opt(), CWriter::WriteBuiltinWaitCall(), HLSCWriter::WriteMainTestbench(), and DiscrepancyAnalysisCWriter::WriteMainTestbench().
|
static |
Return the number of statement + the number of phi in the function.
TM | is the tree manager |
function_index | is the index of the function to be analyzed |
Definition at line 8774 of file tree_helper.cpp.
References GET_NODE, tree_manager::get_tree_node_const(), sl, and THROW_ASSERT.
|
static |
Return a string describing the functino type.
Tree | node of the function type |
|
static |
Return the mangled function name.
fd | is the function decl |
Definition at line 445 of file tree_helper.cpp.
References function_decl::builtin_flag, GET_CONST_NODE, decl_node::mngl, decl_node::name, NormalizeTypename(), THROW_ASSERT, and THROW_ERROR.
Referenced by determine_memory_accesses::analyze_node(), cannot_have_struct_parameters(), tree_manipulation::CloneFunction(), fun_dominator_allocation::Exec(), InterfaceInfer::Exec(), parametric_list_based::exec(), InterfaceInfer::forwardInterface(), FunctionBehavior::FunctionBehavior(), BehavioralHelper::GetMangledFunctionName(), FixStructsPassedByValue::InternalExec(), HDLVarDeclFix::InternalExec(), parm2ssa::InternalExec(), FunctionCallOpt::InternalExec(), SDCScheduling::InternalExec(), BitLatticeManipulator::mix(), InterfaceInfer::setReadInterface(), InterfaceInfer::setWriteInterface(), dead_code_eliminationIPA::signature_opt(), and HLSCWriter::WriteHeader().
|
static |
Return the tree node of parameter types.
ftype | is the function type |
Definition at line 2065 of file tree_helper.cpp.
References CGetType(), GET_CONST_NODE, lenet_tvm::params, STR, and THROW_ASSERT.
Referenced by get_parameter_types(), and RecursiveGetTypesToBeDeclared().
|
static |
Return the real type.
TM | is the tree manager |
index | is the index of the type |
Definition at line 1414 of file tree_helper.cpp.
References tree_manager::CGetTreeReindex(), and GET_INDEX_CONST_NODE.
Referenced by CWriter::DeclareType(), BehavioralHelper::print_type_declaration(), BehavioralHelper::PrintNode(), PrintType(), and HLSCWriter::WriteParamInitialization().
|
static |
Return the real type (same as GetUnqualifiedType, but return type instead of nullptr)
type | is the type |
Definition at line 1420 of file tree_helper.cpp.
References GetUnqualifiedType().
|
static |
Return the name of the class.
type | is the treenode of the class (of a record_type) |
Definition at line 392 of file tree_helper.cpp.
References GET_CONST_NODE, tree_node::get_kind(), GET_NODE, rect(), and test_panda::type.
Referenced by is_builtin_channel().
|
static |
Return where a function or a type is defined.
node | type or decl treenode |
is_system | stores if function or type has been already recognized as a system one |
Definition at line 549 of file tree_helper.cpp.
References GET_CONST_NODE.
Referenced by CBackend::AnalyzeInclude(), CWriter::DeclareType(), and BehavioralHelper::get_definition().
|
static |
Return the name of template without parameters.
Ex: sc_signal<T> –> sc_signal
type | is the treenode of the class template (of a record_type) |
Definition at line 364 of file tree_helper.cpp.
References GET_CONST_NODE, tree_node::get_kind(), GET_NODE, rect(), and test_panda::type.
|
static |
Return name of the type.
type | is the type tree node |
Definition at line 1782 of file tree_helper.cpp.
References CASE_BINARY_EXPRESSION, CASE_CPP_NODES, CASE_CST_NODES, CASE_DECL_NODES, CASE_GIMPLE_NODES, CASE_PRAGMA_NODES, CASE_QUATERNARY_EXPRESSION, CASE_TERNARY_EXPRESSION, CASE_UNARY_EXPRESSION, GET_CONST_NODE, tree_node::get_kind(), GetConstValue(), NormalizeTypename(), rect(), SC_tmpl_class, STR, THROW_ASSERT, THROW_ERROR, THROW_UNREACHABLE, and test_panda::type.
Referenced by CWriter::DeclareType(), IsBooleanType(), IsSignedIntegerType(), IsUnsignedIntegerType(), and BehavioralHelper::PrintNode().
|
static |
Return the types to be declared after declaring index type.
tn | is the starting type |
without_transformation | specifies if we are not restructuring the code |
Definition at line 1101 of file tree_helper.cpp.
References RecursiveGetTypesToBeDeclared().
Referenced by CBackend::AnalyzeInclude(), and CWriter::DeclareType().
|
static |
Return the types to be declared before declaring index type.
tn | is the starting type |
without_transformation | specifies if we are not restructuring the code |
Definition at line 1093 of file tree_helper.cpp.
References RecursiveGetTypesToBeDeclared().
Referenced by CBackend::AnalyzeInclude(), and CWriter::DeclareType().
|
static |
Return the unqualified version of a type.
TM | is the tree_manager |
type | is the type |
Definition at line 5080 of file tree_helper.cpp.
References tree_manager::CGetTreeNode(), GetUnqualifiedType(), and tree_node::index.
Referenced by BehavioralHelper::GetUnqualified().
|
static |
Return the unqualified version of a type.
type | is the type |
Definition at line 5086 of file tree_helper.cpp.
References GET_CONST_NODE, tree_node::get_kind(), and test_panda::type.
Referenced by GetRealType(), and GetUnqualified().
|
static |
Return true if the function index returns a not void type, false otherwise.
index | is the treenode_index of the functionsFIXME: to be remove after substitution with HasReturnType |
|
static |
Check if omp simd pragmas are present in given statement list.
sl | statement list to analyse |
Definition at line 8912 of file tree_helper.cpp.
References GET_NODE, statement_list::list_of_bloc, and THROW_ASSERT.
Referenced by LoopsAnalysisBambu::ComputeFrontendRelationships(), Vectorize::ComputeFrontendRelationships(), and FunctionCallOpt::InternalExec().
|
static |
Return true if the function index returns a not void type, false otherwise.
type | is the treenode of the functions |
|
static |
Return true if the type has to be declared.
type | is the treenode |
Definition at line 2561 of file tree_helper.cpp.
References GET_CONST_NODE, tree_node::get_kind(), PrintType(), SplitString(), STR, THROW_ASSERT, and test_panda::type.
Referenced by tree_manager::collapse_into(), and CWriter::DeclareType().
|
static |
Return if treenode index is a complex.
TM | is the tree_manager |
index | is the treenode index |
Definition at line 2341 of file tree_helper.cpp.
References tree_manager::CGetTreeReindex(), and IsComplexType().
Referenced by VcdSignalSelection::InitialSsaIsAddress(), BehavioralHelper::is_a_complex(), Bit_Value_opt::optimize(), VcdSignalSelection::SelectInitialSsa(), and VcdSignalSelection::SingleStepPropagateAddrSsa().
|
static |
Return if treenode index is a function_decl.
TM | is the tree_manager |
index | is the treenode indexFIXME: to be remove after substitution with IsFunctionDeclaration |
Definition at line 2509 of file tree_helper.cpp.
References tree_manager::CGetTreeReindex(), and IsFunctionDeclaration().
Referenced by get_type_index().
|
static |
Return true if the treenode index is a a misaligned access to a vector data object.
TM | is the tree_manager |
index | is the treenode index |
Definition at line 2537 of file tree_helper.cpp.
References tree_manager::CGetTreeReindex(), CGetType(), GET_CONST_NODE, IsVectorType(), Size(), STR, and THROW_ASSERT.
Referenced by memory_allocation::finalize_memory_allocation(), and fu_binding::specialise_fu().
|
static |
Definition at line 8201 of file tree_helper.cpp.
References function_decl::body, bloc::ENTRY_BLOCK_ID, bloc::EXIT_BLOCK_ID, GET_CONST_NODE, sl, and THROW_ASSERT.
Referenced by operations_cfg_computation::build_operation_recursive(), fun_dominator_allocation::Exec(), get_required_values(), and dead_code_elimination::InternalExec().
|
static |
Return if treenode index is a pointer.
TM | is the tree_manager |
index | is the treenode indexFIXME: to be remove after substitution with IsPointerType |
Definition at line 2481 of file tree_helper.cpp.
References tree_manager::CGetTreeReindex(), and IsPointerType().
Referenced by mux_connection_binding::create_connections(), CreateAddressTranslation::Exec(), memory_allocation::finalize_memory_allocation(), get_type_index(), BehavioralHelper::is_a_pointer(), VcdSignalSelection::IsAddressType(), and Bit_Value_opt::optimize().
|
static |
Return if treenode index is a record.
TM | is the tree_manager |
index | is the treenode indexFIXME: to be remove after substitution with IsStructType |
Definition at line 2315 of file tree_helper.cpp.
References tree_manager::CGetTreeReindex(), and IsStructType().
Referenced by AllocationInformation::get_correction_time(), and BehavioralHelper::is_a_struct().
|
static |
FIXME: to be remove after substitution with IsVariableType.
Definition at line 2961 of file tree_helper.cpp.
References tree_manager::CGetTreeReindex(), and IsVariableType().
|
static |
Return true if the treenode index is a vector.
TM | is the tree_manager |
index | is the treenode indexFIXME: to be remove after substitution with IsVectorType |
Definition at line 2524 of file tree_helper.cpp.
References tree_manager::CGetTreeReindex(), and IsVectorType().
Referenced by PhiOpt::ApplyIfMerge(), PhiOpt::ApplyIfRemove(), PhiOpt::ApplyMultiMerge(), PhiOpt::ApplyMultiRemove(), short_circuit_taf::create_gimple_cond(), PhiOpt::IdentifyPattern(), BehavioralHelper::is_a_vector(), VcdSignalSelection::IsAddressType(), Bit_Value_opt::optimize(), and VcdSignalSelection::SingleStepPropagateAddrSsa().
|
static |
Return true if the treenode is of void type.
TM | is the tree_manager |
index | is the treenode indexFIXME: to be remove after substitution with IsVoidType |
Definition at line 2645 of file tree_helper.cpp.
References tree_manager::CGetTreeReindex(), and IsVoidType().
|
static |
Return if treenode index is an address expression.
TM | is the tree manager |
index | is the treenode index |
Definition at line 2556 of file tree_helper.cpp.
References tree_manager::CGetTreeNode(), and tree_node::get_kind().
|
static |
Return if treenode index is an array or it is equivalent to an array (record recursively having a single field ending into a single arrays)
TM | is the tree_manager |
index | is the treenode indexFIXME: to be remove after substitution with IsArrayEquivType |
Definition at line 2442 of file tree_helper.cpp.
References tree_manager::CGetTreeReindex(), and IsArrayEquivType().
Referenced by AllocationInformation::get_correction_time(), BehavioralHelper::is_an_array(), and VcdSignalSelection::IsAddressType().
|
static |
Return if treenode index is an enumeral type.
TM | is the tree_manager |
index | is the treenode indexFIXME: to be remove after substitution with IsEnumType |
Definition at line 2302 of file tree_helper.cpp.
References tree_manager::CGetTreeReindex(), and IsEnumType().
Referenced by BehavioralHelper::is_an_enum().
|
static |
Return if treenode index is an union.
TM | is the tree_manager |
index | is the treenode index |
Definition at line 2328 of file tree_helper.cpp.
References tree_manager::CGetTreeReindex(), and IsUnionType().
Referenced by AllocationInformation::get_correction_time(), and BehavioralHelper::is_an_union().
|
static |
Return true if the treenode is of bool type.
TM | is the tree_manager |
index | is the treenode indexFIXME: to be remove after substitution with IsBooleanType |
Definition at line 2625 of file tree_helper.cpp.
References tree_manager::CGetTreeReindex(), and IsBooleanType().
Referenced by mux_connection_binding::create_connections(), and BehavioralHelper::is_bool().
|
static |
This function test if a given index is a SystemC builtin channel.
TM | is the tree_manager |
index | is the treenode |
Definition at line 2764 of file tree_helper.cpp.
References tree_manager::CGetTreeNode(), tree_manager::CGetTreeReindex(), GetRecordTypeName(), and THROW_ASSERT.
Referenced by is_channel().
|
static |
This function test if a given index is a SystemC channel.
TM | is the tree_manager |
index | is the treenode |
Definition at line 2771 of file tree_helper.cpp.
References tree_manager::CGetTreeNode(), GET_CONST_NODE, is_builtin_channel(), look_for_binfo_inheritance(), and THROW_ASSERT.
|
static |
This function test if a given index as parm is a SystemC sc_clock.
TM | is the tree_manager |
index | is the treenode |
Definition at line 2823 of file tree_helper.cpp.
References tree_manager::CGetTreeNode(), GET_CONST_NODE, look_for_binfo_inheritance(), and THROW_ASSERT.
|
static |
check if a given tree node is a concatenation operation
TM | is the tree_manager |
index | is the index of the tree_node |
Definition at line 4521 of file tree_helper.cpp.
References tree_node::get_kind(), GET_NODE, and tree_manager::get_tree_node_const().
Referenced by AllocationInformation::GetNodeTypePrec().
|
static |
Return if the treenode is of const type.
TM | is the tree_manager |
index | is the treenode index |
Definition at line 4254 of file tree_helper.cpp.
References tree_manager::CGetTreeReindex(), and IsConstType().
|
static |
Return if a tree node is a constant object.
TM | is the tree_manager |
index | is the index of the tree_node |
Definition at line 4592 of file tree_helper.cpp.
References tree_manager::CGetTreeReindex(), and IsConstant().
Referenced by simple_code_motion::CheckMovable(), commutative_expr_restructuring::IsCommExprChain(), and CondExprRestructuring::IsCondExprChain().
|
static |
This function test if a given index is a SystemC event.
TM | is the tree_manager |
index | is the treenode |
Definition at line 2945 of file tree_helper.cpp.
References tree_manager::CGetTreeNode(), GET_CONST_NODE, look_for_binfo_inheritance(), and THROW_ASSERT.
|
static |
FIXME: to be remove after substitution with IsExternDeclaration.
Definition at line 4230 of file tree_helper.cpp.
References tree_manager::CGetTreeReindex(), and IsExternDeclaration().
Referenced by BehavioralHelper::is_extern(), DiscrepancyAnalysisCWriter::WriteFunctionDeclaration(), and DiscrepancyAnalysisCWriter::WriteFunctionImplementation().
|
static |
FIXME: to be remove after substitution with IsPointerResolved.
Definition at line 3852 of file tree_helper.cpp.
References tree_manager::CGetTreeReindex(), and IsPointerResolved().
|
static |
Return true if the treenode is of type function pointer type.
TM | is the tree_manager |
index | is the treenode_indexFIXME: to be remove after substitution with IsFunctionPointerType |
Definition at line 2604 of file tree_helper.cpp.
References tree_manager::CGetTreeReindex(), and IsFunctionPointerType().
|
static |
Return true if the treenode is of type function type.
TM | is the tree_manager |
index | is the treenode_indexFIXME: to be remove after substitution with IsFunctionType |
Definition at line 2592 of file tree_helper.cpp.
References tree_manager::CGetTreeReindex(), and IsFunctionType().
|
static |
This function test if a given index is a SystemC input port.
TM | is the tree_manager |
index | is the treenode |
Definition at line 2896 of file tree_helper.cpp.
References tree_manager::CGetTreeNode(), GET_CONST_NODE, look_for_binfo_inheritance(), and THROW_ASSERT.
|
static |
This function test if a given index is a SystemC in-output port.
TM | is the tree_manager |
index | is the treenode |
Definition at line 2929 of file tree_helper.cpp.
References tree_manager::CGetTreeNode(), GET_CONST_NODE, look_for_binfo_inheritance(), and THROW_ASSERT.
|
static |
Return true if the treenode is of integer type.
TM | is the tree_manager |
index | is the treenode indexFIXME: to be remove after substitution with IsSignedIntegerType |
Definition at line 2677 of file tree_helper.cpp.
References tree_manager::CGetTreeReindex(), and IsSignedIntegerType().
Referenced by Bit_Value::backward_transfer(), BitLatticeManipulator::constructor_bitstring(), convert_bitvalue_to_integer_cst(), mux_connection_binding::create_connections(), AllocationInformation::GetConnectionTime(), IR_lowering::InternalExec(), BehavioralHelper::is_int(), Bit_Value_opt::optimize(), lut_transformation::ProcessBasicBlock(), and BitLatticeManipulator::string_cst_bitstring().
|
static |
This function test if a given index is a SystemC module.
TM | is the tree_manager |
index | is the treenode |
Definition at line 2745 of file tree_helper.cpp.
References tree_manager::CGetTreeNode(), GET_CONST_NODE, look_for_binfo_inheritance(), and THROW_ASSERT.
|
static |
Return true if the treenode is a ssa_name greater or equal to zero.
TM | is the tree_manager |
index | is the treenode indexFIXME: to be remove after substitution with IsPositiveIntegerValue |
Definition at line 2658 of file tree_helper.cpp.
References tree_manager::CGetTreeReindex(), and IsPositiveIntegerValue().
Referenced by Bit_Value::initialize(), and BehavioralHelper::is_natural().
|
static |
This function test if a given index is a SystemC output port.
TM | is the tree_manager |
index | is the treenode |
Definition at line 2912 of file tree_helper.cpp.
References tree_manager::CGetTreeNode(), GET_CONST_NODE, look_for_binfo_inheritance(), and THROW_ASSERT.
|
static |
FIXME: to be remove after substitution with IsPackedType.
Definition at line 6291 of file tree_helper.cpp.
References tree_manager::CGetTreeReindex(), and IsPackedType().
|
static |
Check if the access is on a packed data structure or not.
TreeM | is the tree manager |
node_index | is the node id under check |
Definition at line 6430 of file tree_helper.cpp.
References CASE_CPP_NODES, CASE_CST_NODES, CASE_FAKE_NODES, CASE_GIMPLE_NODES, CASE_PRAGMA_NODES, CASE_TYPE_NODES, tree_manager::CGetTreeNode(), GET_CONST_NODE, GET_INDEX_CONST_NODE, and THROW_ERROR.
Referenced by memory_allocation::finalize_memory_allocation().
|
static |
return true in case the index corresponds to a parameter in ssa form or not
TM | is the tree manager |
index | is the id of a potential parameter |
Definition at line 4169 of file tree_helper.cpp.
References GET_NODE, tree_manager::get_tree_node_const(), and THROW_ASSERT.
Referenced by mux_connection_binding::connect_to_registers(), StorageValueInformation::Initialize(), cdfc_module_binding::initialize_connection_relation(), FSM_NI_SSA_liveness::InternalExec(), values_scheme::InternalExec(), port_swapping::InternalExec(), and HLS_manager::is_register_compatible().
|
static |
This function test if a given index is a SystemC port.
TM | is the tree_manager |
index | is the treenode |
Definition at line 2879 of file tree_helper.cpp.
References tree_manager::CGetTreeNode(), GET_CONST_NODE, look_for_binfo_inheritance(), and THROW_ASSERT.
|
static |
Return true if the treenode is of real type.
TM | is the tree_manager |
index | is the treenode index |
Definition at line 2699 of file tree_helper.cpp.
References tree_manager::CGetTreeReindex(), and IsRealType().
Referenced by simple_code_motion::CheckMovable(), mux_connection_binding::create_connections(), VcdSignalSelection::InitialSsaIsAddress(), IR_lowering::InternalExec(), BehavioralHelper::is_real(), Bit_Value_opt::optimize(), VcdSignalSelection::SelectInitialSsa(), and VcdSignalSelection::SingleStepPropagateAddrSsa().
|
static |
This function test if a given index as parm is a SC_BIND_PROXY_NIL.
TM | is the tree_manager |
index | is the treenode |
Definition at line 2842 of file tree_helper.cpp.
References tree_manager::CGetTreeNode(), GET_CONST_NODE, and THROW_ASSERT.
|
static |
Return true if the treenode is an int, an unsigned, a real or a Boolean data type.
TM | is the tree_manager |
index | is the treenode indexFIXME: to be remove after substitution with IsScalarType |
Definition at line 2735 of file tree_helper.cpp.
References tree_manager::CGetTreeReindex(), and IsScalarType().
|
static |
This function test if a given index is a SystemC sc_signal.
TM | is the tree_manager |
index | is the treenode |
Definition at line 2802 of file tree_helper.cpp.
References tree_manager::CGetTreeNode(), GET_CONST_NODE, look_for_binfo_inheritance(), and THROW_ASSERT.
|
static |
check if a given tree node is a simple pointer plus expression
TM | is the tree_manager |
index | is the index of the tree_node |
Definition at line 4557 of file tree_helper.cpp.
References tree_node::get_kind(), GET_NODE, and tree_manager::get_tree_node_const().
|
static |
Return true in case index is a ssa_name.
TM | is the tree manager |
index | is the index of a possible ssa_name |
Definition at line 4186 of file tree_helper.cpp.
References tree_manager::get_tree_node_const(), and THROW_ASSERT.
Referenced by StorageValueInformation::Initialize(), FSM_NI_SSA_liveness::InternalExec(), and HLS_manager::is_register_compatible().
|
static |
FIXME: to be remove after substitution with IsStaticDeclaration.
Definition at line 4206 of file tree_helper.cpp.
References tree_manager::CGetTreeReindex(), and IsStaticDeclaration().
Referenced by BehavioralHelper::is_static(), PrintType(), DiscrepancyAnalysisCWriter::WriteFunctionDeclaration(), and DiscrepancyAnalysisCWriter::WriteFunctionImplementation().
|
static |
Return true if variable or type is a system one.
TM | is the tree manager |
index | is the index of the treenode corresponding to the decl node or to the type node |
Definition at line 1051 of file tree_helper.cpp.
References tree_manager::CGetTreeReindex(), and IsSystemType().
Referenced by BehavioralHelper::function_has_to_be_printed().
|
static |
Return true if the treenode is of unsigned integer type.
TM | is the tree_manager |
index | is the treenode indexFIXME: to be remove after substitution with IsUnsignedIntegerType |
Definition at line 2712 of file tree_helper.cpp.
References tree_manager::CGetTreeReindex(), and IsUnsignedIntegerType().
Referenced by mux_connection_binding::create_connections(), IR_lowering::expand_mult_highpart(), and BehavioralHelper::is_unsigned().
|
static |
return true in case the ssa_name is virtual
TM | is the tree manager |
index | is the id of a potential ssa_name |
Definition at line 4194 of file tree_helper.cpp.
References tree_manager::get_tree_node_const(), and THROW_ASSERT.
Referenced by StorageValueInformation::Initialize(), FSM_NI_SSA_liveness::InternalExec(), NI_SSA_liveness::InternalExec(), and HLS_manager::is_register_compatible().
|
static |
return true in case the index corresponds to a volatile variable
TM | is the tree manager |
index | is the id of a variable/ssa_name |
Definition at line 4148 of file tree_helper.cpp.
References tree_manager::CGetTreeReindex(), and IsVolatile().
|
static |
Return true if type has not default alignment.
Definition at line 5096 of file tree_helper.cpp.
References tree_manager::CGetTreeReindex().
Referenced by RecursiveGetTypesToBeDeclared().
|
static |
Definition at line 5101 of file tree_helper.cpp.
References GET_CONST_NODE, tree_node::get_kind(), STR, THROW_ASSERT, and test_panda::type.
|
static |
Return true if treenode is an array or it is equivalent to an array (record recursively having a single field ending into a single arrays)
type | is the treenode |
Definition at line 2448 of file tree_helper.cpp.
References CGetType(), GET_CONST_NODE, same_size_fields(), THROW_ASSERT, and test_panda::type.
Referenced by operations_cfg_computation::build_operation_recursive(), constructor_range(), fu_binding::fill_array_ref_memory(), AllocationInformation::get_correction_time(), MemoryInitializationWriterBase::GoNext(), CSE::has_memory_access(), mem_dominator_allocation::InternalExec(), is_an_array(), and InterfaceInfer::interface_info::update().
|
static |
Return true if treenode is an array.
type | is the treenode |
Definition at line 2463 of file tree_helper.cpp.
References CGetType(), GET_CONST_NODE, THROW_ASSERT, and test_panda::type.
Referenced by InterfaceInfer::Exec(), AllocationInformation::GetNodeTypePrec(), MemoryInitializationWriterBase::GoDown(), mux_connection_binding::object_bitsize(), TestbenchGeneration::print_var_init(), BehavioralHelper::PrintNode(), and HLSCWriter::WriteMainTestbench().
|
static |
Return true if the treenode is of bool type.
type | is the treenode index |
Definition at line 2631 of file tree_helper.cpp.
References CGetType(), GET_CONST_NODE, GetTypeName(), and THROW_ASSERT.
Referenced by mux_connection_binding::add_conversion(), tree_manipulation::create_binary_operation(), mux_connection_binding::create_connections(), short_circuit_taf::create_gimple_cond(), tree_manipulation::create_gimple_cond(), tree_manipulation::ExtractCondition(), fu_binding::fill_array_ref_memory(), Bit_Value::forward_transfer(), AllocationInformation::GetNodeTypePrec(), BitLatticeManipulator::inf(), ExtractGimpleCondOp::InternalExec(), IR_lowering::InternalExec(), allocation::InternalExec(), is_bool(), IsScalarType(), Bit_Value_opt::optimize(), TestVectorParser::ParseXMLFile(), lut_transformation::ProcessBasicBlock(), and BitLatticeManipulator::sup().
|
static |
Return if treenode is a complex.
type | is the treenode |
Definition at line 2347 of file tree_helper.cpp.
References CGetType(), GET_CONST_NODE, and THROW_ASSERT.
Referenced by lut_transformation::CHECK_BIN_EXPR_BOOL_SIZE(), lut_transformation::CHECK_BIN_EXPR_INT_SIZE(), lut_transformation::CHECK_COND_EXPR_SIZE(), lut_transformation::CHECK_NOT_EXPR_SIZE(), fu_binding::fill_array_ref_memory(), memory_allocation::finalize_memory_allocation(), HLS_manager::get_constant_string(), AllocationInformation::GetNodeTypePrec(), extract_patterns::InternalExec(), mem_dominator_allocation::InternalExec(), allocation::InternalExec(), is_a_complex(), BitLatticeManipulator::IsHandledByBitvalue(), dead_code_elimination::kill_uses(), and DiscrepancyAnalysisCWriter::writePostInstructionInfo().
|
static |
Return if a tree node is a constant object.
node | is the tree_node |
Definition at line 4598 of file tree_helper.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, GET_CONST_NODE, and tree_node::get_kind().
Referenced by __arg_suffix(), simple_code_motion::CheckMovable(), FunctionCallOpt::compute_cost(), IR_lowering::division_by_a_constant(), AllocationInformation::GetNodeTypePrec(), FunctionCallOpt::HasConstantArgs(), is_constant(), and BitLatticeManipulator::Size().
|
static |
Return true if the treenode is of const type.
type | is the treenode |
Definition at line 4260 of file tree_helper.cpp.
References CGetType(), FIRST_TOKEN, GET_CONST_NODE, THROW_ASSERT, TOK_QUAL_C, TOK_QUAL_CV, and TOK_QUAL_CVR.
Referenced by is_const_type().
|
static |
Return if treenode index is an enumeral type.
type | is the treenode |
Definition at line 2308 of file tree_helper.cpp.
References CGetType(), GET_CONST_NODE, and THROW_ASSERT.
Referenced by fu_binding::fill_array_ref_memory(), allocation::InternalExec(), and is_an_enum().
|
static |
Definition at line 4235 of file tree_helper.cpp.
References GET_CONST_NODE, and tree_node::get_kind().
Referenced by discrepancy_instruction_writer::declareFunction(), and is_extern().
|
static |
Return true if treenode is a function_decl.
type | is the treenode |
Definition at line 2514 of file tree_helper.cpp.
References GET_CONST_NODE, tree_node::get_kind(), and THROW_ASSERT.
Referenced by CBackend::AnalyzeInclude(), and is_a_function().
|
static |
Return true if the treenode is of type function pointer type.
type | is the treenode |
Definition at line 2610 of file tree_helper.cpp.
References CGetType(), GET_CONST_NODE, and THROW_ASSERT.
Referenced by is_function_pointer_type(), and BehavioralHelper::PrintNode().
|
static |
Return true if the treenode is of type function type.
type | is the treenode |
Definition at line 2597 of file tree_helper.cpp.
References CGetType(), GET_CONST_NODE, and THROW_ASSERT.
Referenced by is_function_type(), and soft_float_cg_ext::signature_lowering().
|
static |
Return true if the decl node or type is in libbambu.
TM | is the tree manager |
index | is the treenode indexFIXME: to be remove after substitution with IsInLibbambu |
Definition at line 1072 of file tree_helper.cpp.
References tree_manager::CGetTreeReindex().
Referenced by CBackend::AnalyzeInclude(), CWriter::DeclareType(), CWriter::DeclareVariable(), BehavioralHelper::function_has_to_be_printed(), BehavioralHelper::PrintVarDeclaration(), and CheckSystemType::recursive_examinate().
|
static |
Return true if the decl node or type is in libbambu.
type | is the treenode |
Definition at line 1078 of file tree_helper.cpp.
References GET_CONST_NODE, tree_node::get_kind(), and test_panda::type.
|
static |
Return true if the tree node is a gimple_assign reading something which will be allocated in memory.
tn | is the tree node |
fun_mem_data | is the set of memory variables of the function |
check for bit field ref of vector type
Definition at line 8844 of file tree_helper.cpp.
References CGetType(), GET_CONST_NODE, tree_node::get_kind(), and IsVectorType().
Referenced by operations_cfg_computation::build_operation_recursive(), BehavioralHelper::IsLoad(), LoadOpNode::opCtorGenerator(), and soft_float_cg_ext::RecursiveExaminate().
|
static |
Return true in case the right operation is a lut_expr.
TM | is the tree manager |
tn | is the tree node |
Definition at line 8900 of file tree_helper.cpp.
References GET_CONST_NODE, and tree_node::get_kind().
Referenced by BehavioralHelper::IsLut().
|
static |
Print the contents of the structure
Definition at line 6297 of file tree_helper.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_UNARY_EXPRESSION, GET_CONST_NODE, tree_node::get_kind(), THROW_ASSERT, THROW_UNREACHABLE, and test_panda::type.
Referenced by mem_dominator_allocation::InternalExec(), and is_packed().
|
static |
Definition at line 3859 of file tree_helper.cpp.
References CASE_CPP_NODES, CASE_FAKE_NODES, CASE_GIMPLE_NODES, CASE_PRAGMA_NODES, CASE_TYPE_NODES, check_for_simple_pointer_arithmetic(), GET_CONST_NODE, tree_node::get_kind(), NODE_NOT_YET_SUPPORTED_EC, STR, THROW_ASSERT, and THROW_ERROR_CODE.
Referenced by mem_dominator_allocation::InternalExec(), and is_fully_resolved().
|
static |
Return true if treenode index is a pointer.
typw | is the treenode |
Definition at line 2486 of file tree_helper.cpp.
References CGetType(), GET_CONST_NODE, and THROW_ASSERT.
Referenced by mux_connection_binding::add_conversion(), AllocatedMemorySize(), determine_memory_accesses::analyze_node(), operations_cfg_computation::build_operation_recursive(), minimal_interface::build_wrapper(), InterfaceInfer::ChasePointerInterfaceRecurse(), TestbenchGeneration::Exec(), InterfaceInfer::Exec(), fu_binding::fill_array_ref_memory(), AllocationInformation::GetNodeTypePrec(), MemoryInitializationWriterBase::GoDown(), MemoryInitializationWriterBase::GoNext(), CSE::has_memory_access(), soft_float_cg_ext::int_type_for(), allocation::InternalExec(), is_a_pointer(), soft_float_cg_ext::lowering_needed(), Bit_Value_opt::optimize(), TestVectorParser::ParseXMLFile(), BehavioralHelper::PrintNode(), soft_float_cg_ext::RecursiveExaminate(), RecursiveGetTypesToBeDeclared(), InterfaceInfer::setReadInterface(), InterfaceInfer::setWriteInterface(), soft_float_cg_ext::signature_lowering(), InterfaceInfer::interface_info::update(), HLSCWriter::WriteMainTestbench(), HLSCWriter::WriteParamDecl(), HLSCWriter::WriteParamInitialization(), and HLSCWriter::WriteTestbenchFunctionCall().
|
static |
Return true if the treenode is a ssa_name greater or equal to zero.
type | is the treenode |
Definition at line 2664 of file tree_helper.cpp.
References GET_CONST_NODE, tree_node::get_kind(), GetConstValue(), min, STR, THROW_ASSERT, and test_panda::type.
Referenced by is_natural().
|
static |
Return true if the treenode is of real type.
type | is the treenode |
Definition at line 2705 of file tree_helper.cpp.
References CGetType(), GET_CONST_NODE, and THROW_ASSERT.
Referenced by StorageValueInformation::are_value_bitsize_compatible(), lut_transformation::CHECK_BIN_EXPR_BOOL_SIZE(), lut_transformation::CHECK_BIN_EXPR_INT_SIZE(), lut_transformation::CHECK_COND_EXPR_SIZE(), lut_transformation::CHECK_NOT_EXPR_SIZE(), simple_code_motion::CheckMovable(), Bit_Value_opt::constrainSSA(), mux_connection_binding::create_connections(), tree_manager::create_unique_const(), fu_binding::fill_array_ref_memory(), HLS_manager::get_constant_string(), AllocationInformation::GetNodeTypePrec(), extract_patterns::InternalExec(), IR_lowering::InternalExec(), allocation::InternalExec(), is_real(), BitLatticeManipulator::IsHandledByBitvalue(), IsScalarType(), dead_code_elimination::kill_uses(), soft_float_cg_ext::lowering_needed(), Bit_Value_opt::optimize(), BehavioralHelper::PrintConstant(), soft_float_cg_ext::RecursiveExaminate(), InterfaceInfer::setReadInterface(), InterfaceInfer::setWriteInterface(), soft_float_cg_ext::signature_lowering(), Size(), CWriter::WriteBuiltinWaitCall(), HLSCWriter::WriteMainTestbench(), HLSCWriter::WriteParamInitialization(), and DiscrepancyAnalysisCWriter::writePostInstructionInfo().
|
static |
Given two nodes tells if they have same base type (const is not considered: const double == double)
tn0 | first node to compare |
tn1 | second node to compare |
Definition at line 2087 of file tree_helper.cpp.
References CGetType(), GET_CONST_NODE, and Size().
Referenced by mux_connection_binding::create_connections(), soft_float_cg_ext::generate_interface(), FunctionCallTypeCleanup::InternalExec(), dead_code_elimination::InternalExec(), IR_lowering::InternalExec(), Bit_Value_opt::optimize(), FunctionCallTypeCleanup::ParametersTypeCleanup(), InterfaceInfer::setReadInterface(), and InterfaceInfer::setWriteInterface().
|
static |
Return true if the treenode is an int, an unsigned, a real or a Boolean data type.
type | is the treenode |
Definition at line 2740 of file tree_helper.cpp.
References IsBooleanType(), IsRealType(), IsSignedIntegerType(), and IsUnsignedIntegerType().
Referenced by BitValueIPA::Exec(), and is_scalar().
|
static |
Return true if the treenode is of integer type.
type | is the treenode |
Definition at line 2683 of file tree_helper.cpp.
References CGetType(), GET_CONST_NODE, GetTypeName(), and THROW_ASSERT.
Referenced by mux_connection_binding::add_conversion(), StorageValueInformation::are_value_bitsize_compatible(), Bit_Value::backward_transfer(), lut_transformation::CHECK_BIN_EXPR_BOOL_SIZE(), lut_transformation::CHECK_COND_EXPR_SIZE(), lut_transformation::CHECK_NOT_EXPR_SIZE(), Bit_Value_opt::constrainSSA(), mux_connection_binding::create_connections(), tree_manager::CreateUniqueIntegerCst(), BitValueIPA::Exec(), Bit_Value::forward(), AllocationInformation::GetNodeTypePrec(), Bit_Value::initialize(), IR_lowering::InternalExec(), allocation::InternalExec(), is_int(), IsScalarType(), BitLatticeManipulator::IsSignedIntegerType(), Bit_Value_opt::optimize(), BehavioralHelper::PrintNode(), Size(), and CWriter::WriteBuiltinWaitCall().
|
static |
Definition at line 4211 of file tree_helper.cpp.
References GET_CONST_NODE, and tree_node::get_kind().
Referenced by discrepancy_instruction_writer::declareFunction(), and is_static().
|
static |
Return true if the tree node is a gimple_assign writing something which will be allocated in memory.
tn | is the tree node |
fun_mem_data | is the set of memory variables of the function |
Definition at line 8798 of file tree_helper.cpp.
References CGetType(), GET_CONST_NODE, and tree_node::get_kind().
Referenced by operations_cfg_computation::build_operation_recursive(), BehavioralHelper::IsStore(), and soft_float_cg_ext::RecursiveExaminate().
|
static |
Return true if treenode is a record.
type | is the treenode |
Definition at line 2321 of file tree_helper.cpp.
References CGetType(), GET_CONST_NODE, and THROW_ASSERT.
Referenced by cannot_have_struct_parameters(), lut_transformation::CHECK_BIN_EXPR_BOOL_SIZE(), lut_transformation::CHECK_BIN_EXPR_INT_SIZE(), lut_transformation::CHECK_COND_EXPR_SIZE(), lut_transformation::CHECK_NOT_EXPR_SIZE(), fu_binding::fill_array_ref_memory(), memory_allocation::finalize_memory_allocation(), AllocationInformation::GetNodeTypePrec(), MemoryInitializationWriterBase::GoDown(), MemoryInitializationWriterBase::GoNext(), FixStructsPassedByValue::InternalExec(), mem_dominator_allocation::InternalExec(), is_a_struct(), BitLatticeManipulator::IsHandledByBitvalue(), mux_connection_binding::object_bitsize(), BehavioralHelper::PrintNode(), same_size_fields(), InterfaceInfer::interface_info::update(), HLSCWriter::WriteMainTestbench(), and DiscrepancyAnalysisCWriter::writePostInstructionInfo().
|
static |
Return true if variable or type is a system one.
type | is the treenode corresponding to the decl node or to the type node |
Definition at line 1057 of file tree_helper.cpp.
References GET_CONST_NODE, tree_node::get_kind(), and test_panda::type.
Referenced by CWriter::DeclareVariable(), is_system(), BehavioralHelper::PrintConstant(), and DiscrepancyAnalysisCWriter::WriteExtraInitCode().
|
static |
Return if treenode is an union.
type | is the treenode |
Definition at line 2334 of file tree_helper.cpp.
References CGetType(), GET_CONST_NODE, and THROW_ASSERT.
Referenced by cannot_have_struct_parameters(), fu_binding::fill_array_ref_memory(), memory_allocation::finalize_memory_allocation(), AllocationInformation::GetNodeTypePrec(), MemoryInitializationWriterBase::GoDown(), FixStructsPassedByValue::InternalExec(), mem_dominator_allocation::InternalExec(), is_an_union(), mux_connection_binding::object_bitsize(), BehavioralHelper::PrintNode(), HLSCWriter::WriteMainTestbench(), and DiscrepancyAnalysisCWriter::writePostInstructionInfo().
|
static |
Return true if the treenode is of unsigned integer type.
type | is the treenode |
Definition at line 2718 of file tree_helper.cpp.
References CGetType(), GET_CONST_NODE, GetTypeName(), and THROW_ASSERT.
Referenced by mux_connection_binding::add_conversion(), operations_cfg_computation::build_operation_recursive(), mux_connection_binding::create_connections(), IR_lowering::division_by_a_constant(), IR_lowering::expand_smod_pow2(), AllocationInformation::GetNodeTypePrec(), IR_lowering::InternalExec(), allocation::InternalExec(), is_unsigned(), IsScalarType(), BehavioralHelper::PrintNode(), MemoryInitializationCWriter::Process(), MemoryInitializationWriter::Process(), hls_div_cg_ext::recursive_examinate(), soft_float_cg_ext::RecursiveExaminate(), and CWriter::WriteBuiltinWaitCall().
|
static |
Return true if the treenode is a valid variable.
node | the treenode |
The following one are not considered as variables, but as operations on the variables
Definition at line 2967 of file tree_helper.cpp.
References CASE_BINARY_EXPRESSION, CASE_CPP_NODES, CASE_FAKE_NODES, CASE_GIMPLE_NODES, CASE_PRAGMA_NODES, CASE_QUATERNARY_EXPRESSION, CASE_TERNARY_EXPRESSION, CASE_TYPE_NODES, CASE_UNARY_EXPRESSION, GET_CONST_NODE, tree_node::get_kind(), tree_node::GetString(), NODE_NOT_YET_SUPPORTED_EC, and THROW_ERROR_CODE.
Referenced by is_a_variable().
|
static |
Return true if the treenode is a vector.
type | is the treenode |
Definition at line 2530 of file tree_helper.cpp.
References CGetType(), GET_CONST_NODE, and THROW_ASSERT.
Referenced by determine_memory_accesses::analyze_node(), operations_cfg_computation::build_operation_recursive(), lut_transformation::CHECK_BIN_EXPR_BOOL_SIZE(), lut_transformation::CHECK_BIN_EXPR_INT_SIZE(), lut_transformation::CHECK_COND_EXPR_SIZE(), lut_transformation::CHECK_NOT_EXPR_SIZE(), tree_manipulation::create_binary_operation(), fu_binding::fill_array_ref_memory(), HLS_manager::get_constant_string(), get_required_values(), AllocationInformation::GetNodeTypePrec(), CSE::has_memory_access(), extract_patterns::InternalExec(), compute_implicit_calls::InternalExec(), dead_code_elimination::InternalExec(), IR_lowering::InternalExec(), allocation::InternalExec(), is_a_misaligned_vector(), is_a_vector(), BitLatticeManipulator::IsHandledByBitvalue(), IsLoad(), dead_code_elimination::kill_uses(), BehavioralHelper::PrintNode(), fu_binding::specialise_fu(), HLSCWriter::WriteMainTestbench(), DiscrepancyAnalysisCWriter::WriteMainTestbench(), HLSCWriter::WriteParamDecl(), and DiscrepancyAnalysisCWriter::writePostInstructionInfo().
|
static |
Return true if the treenode is of void type.
type | is the treenode |
Definition at line 2651 of file tree_helper.cpp.
References CGetType(), GET_CONST_NODE, and THROW_ASSERT.
Referenced by is_a_void(), BehavioralHelper::PrintNode(), HLSCWriter::WriteMainTestbench(), and HLSCWriter::WriteParamInitialization().
|
static |
return true in case the tree node corresponds to a volatile variable
tn | is the tree node |
Definition at line 4153 of file tree_helper.cpp.
References CGetType(), GET_CONST_NODE, tree_node::get_kind(), TOK_QUAL_CVR, TOK_QUAL_V, and TOK_QUAL_VR.
Referenced by determine_memory_accesses::analyze_node(), memory_allocation::finalize_memory_allocation(), and is_volatile().
|
static |
Return true if statement must be the last of a basic block.
statement | is the statement to be analyzed |
Definition at line 8696 of file tree_helper.cpp.
References CASE_BINARY_EXPRESSION, CASE_CPP_NODES, CASE_CST_NODES, CASE_DECL_NODES, CASE_PRAGMA_NODES, CASE_QUATERNARY_EXPRESSION, CASE_TERNARY_EXPRESSION, CASE_TYPE_NODES, CASE_UNARY_EXPRESSION, GET_CONST_NODE, tree_node::get_kind(), THROW_UNREACHABLE, and tree_node::ToString().
Referenced by bloc::PushBack().
Look for inheritance of a class.
b | is the binfo to explore |
bcs | is the name of the base class |
Definition at line 957 of file tree_helper.cpp.
References binfo::get_base(), binfo::get_baseinfo_size(), GET_CONST_NODE, and binfo::type.
Referenced by is_channel(), is_clock(), is_event(), is_in_port(), is_inout_port(), is_module(), is_out_port(), is_port(), and is_signal().
|
static |
Return the name of the function.
tm | is the tree manager |
index | is the treenode_index of the class (is the index of a function_decl)FIXME: to be remove after substitution with GetFunctionName |
Definition at line 417 of file tree_helper.cpp.
References tree_manager::CGetTreeReindex(), and GetFunctionName().
Referenced by fu_binding::add_to_SM(), memory_allocation::allocate_parameters(), build_bus_interface(), WB4_interface::build_WB4_bus_interface(), WB4_interface::build_WB4_complete_logic(), buildCircuit(), CallGraphBuiltinCall::buildTypeToDeclaration(), BehavioralHelper::CanBeMoved(), HLS_step::ComputeRelationships(), HLS_manager::create_HLS(), HWDiscrepancyAnalysis::Exec(), call_graph_computation::Exec(), CallGraphManager::expandCallGraphFromFunction(), parm_decl_taken_address_fix::InternalExec(), CallGraphBuiltinCall::lookForBuiltinCall(), Bit_Value::update_IR(), memory::xwrite(), and memory::xwrite2().
|
static |
Return normalized name of types and variables.
id | is the initial typename |
Definition at line 5120 of file tree_helper.cpp.
References THROW_ASSERT, and U.
Referenced by conn_binding::add_command_ports(), fu_binding::add_to_SM(), operations_cfg_computation::build_operation_recursive(), BB_based_stg::compute_EPP_edge_increments(), HLS_step::ComputeRelationships(), fsm_controller::create_state_machine(), AllocationInformation::get_attribute_of_fu_per_op(), AllocationInformation::get_cycles(), AllocationInformation::get_execution_time(), AllocationInformation::get_initiation_time(), AllocationInformation::get_stage_period(), GetMangledFunctionName(), AllocationInformation::GetNodeTypePrec(), GetTypeName(), OmpAllocation::IntegrateTechnologyLibraries(), pipeline_controller::InternalExec(), BB_based_stg::InternalExec(), allocation::InternalExec(), AllocationInformation::is_operation_bounded(), AllocationInformation::is_operation_PI_registered(), BB_based_stg::optimize_cycles(), AllocationInformation::print_allocated_resources(), print_function_name(), PrintType(), BehavioralHelper::PrintVariable(), VarDeclFix::recursive_examinate(), and DiscrepancyAnalysisCWriter::writePostInstructionInfo().
|
static |
Function return the symbol related with the operator op passed as parameter.
op | is the tree node of the expression |
Definition at line 4637 of file tree_helper.cpp.
References refcount< T >::get().
Referenced by GimpleWriter::GimpleWriter(), and BehavioralHelper::PrintNode().
|
static |
Function return the symbol related with the operator op passed as parameter.
op | is the tree node of the expression |
Definition at line 4642 of file tree_helper.cpp.
References 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, GET_CONST_NODE, tree_node::get_kind(), tree_node::get_kind_text(), GetConstValue(), tree_node::index, STR, THROW_ASSERT, and THROW_ERROR.
|
static |
Return the name of the function in a string.
node | is the function_decl |
Definition at line 467 of file tree_helper.cpp.
References function_decl::body, function_decl::builtin_flag, GET_CONST_NODE, GET_INDEX_CONST_NODE, tree_node::get_kind(), tree_node::get_kind_text(), tree_manager::is_top_function(), attr::list_attr, decl_node::mngl, decl_node::name, NormalizeTypename(), print_type(), THROW_ERROR, TI_getTokenName(), TOK_ASSIGN, TOK_CONVERSION, TOK_LSHIFT, TOK_MEMBER, TOK_OPERATOR, TOK_PRIVATE, TOK_PROTECTED, TOK_PUBLIC, TOK_RSHIFT, and decl_node::type.
Referenced by CallGraphManager::AddCallPoint(), CallGraphManager::AddFunctionAndCallPoint(), determine_memory_accesses::analyze_node(), operations_cfg_computation::build_operation_recursive(), InterfaceInfer::ChasePointerInterfaceRecurse(), tree_manipulation::CloneFunction(), tree_manager::function_index_mngl(), tree_manager::GetFunction(), GetFunctionName(), tree_manipulation::InlineFunctionCall(), HWCallInjection::InternalExec(), call_expr_fix::InternalExec(), IR_lowering::InternalExec(), BehavioralHelper::is_va_start_call(), CallGraphManager::IsCallPoint(), BehavioralHelper::PrintConstant(), BehavioralHelper::PrintInit(), BehavioralHelper::PrintNode(), PrintType(), BehavioralHelper::PrintVariable(), CheckSystemType::recursive_examinate(), soft_float_cg_ext::RecursiveExaminate(), application_manager::RegisterTransformation(), CallGraphManager::RemoveCallPoint(), bloc::RemoveStmt(), and soft_float_cg_ext::soft_float_cg_ext().
|
static |
Print a type and its variable in case var is not zero.
type | is the type of var. |
global | tells if the variable is global |
print_qualifiers | tells if the qualifiers (i.e. "const") have to be printed |
print_storage | tells if the storage (i.e. "static") has to be printed |
var | is the variable. |
vppf | is the pointer to the functor used to dump the possible variable var |
prefix | is the string to be appended at the begining of the printing |
Definition at line 5139 of file tree_helper.cpp.
References tree_manager::CGetTreeReindex(), and PrintType().
Referenced by CallGraphBuiltinCall::buildTypeToDeclaration(), CWriter::compute_phi_nodes(), CallGraphBuiltinCall::ExtendCallGraph(), soft_float_cg_ext::InternalExec(), print_function_name(), PrintType(), soft_float_cg_ext::signature_lowering(), dead_code_eliminationIPA::signature_opt(), and soft_float_cg_ext::soft_float_cg_ext().
|
static |
Print a type and its variable in case var is not zero.
type | is the type of var. |
global | tells if the variable is global |
print_qualifiers | tells if the qualifiers (i.e. "const") have to be printed |
print_storage | tells if the storage (i.e. "static") has to be printed |
var | is the variable. |
vppf | is the pointer to the functor used to dump the possible variable var |
prefix | is the string to be appended at the begining of the printing |
patch for unsigned char
patch for va_list
Ad hoc management of vector of bool
references are translated as pointer type objects
Compute the dimensions
add alignment
tree_list are used for parameters declaration: in that case void_type has to be removed from the last type parameter
Definition at line 5149 of file tree_helper.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::CGetTreeReindex(), CGetType(), debug_level, DEBUG_LEVEL_PARANOIC, GET_CONST_NODE, tree_manager::get_implementation_node(), GET_INDEX_CONST_NODE, GET_INDEX_NODE, tree_node::get_kind(), GET_NODE, GetConstValue(), GetRealType(), INDENT_DBG_MEX, tree_node::index, is_static(), NormalizeTypename(), print_function_name(), print_type(), return_C_qualifiers(), Size(), SplitString(), STR, THROW_ASSERT, THROW_ERROR, THROW_UNREACHABLE, and test_panda::type.
Referenced by HLSInstructionWriter::declareFunction(), InstructionWriter::declareFunction(), InterfaceInfer::Exec(), HasToBeDeclared(), BehavioralHelper::print_forward_declaration(), BehavioralHelper::print_type(), print_type(), BehavioralHelper::print_type_declaration(), BehavioralHelper::PrintConstant(), BehavioralHelper::PrintNode(), BehavioralHelper::PrintVarDeclaration(), BehavioralHelper::PrintVariable(), CWriter::WriteBuiltinWaitCall(), HLSCWriter::WriteMainTestbench(), DiscrepancyAnalysisCWriter::WriteMainTestbench(), HLSCWriter::WriteParamDecl(), and HLSCWriter::WriteParamInitialization().
|
staticprivate |
Return the types to be declared before/after declaring type.
returned_types | is the set of type declarations |
type | is the starting type |
recursion | must be set to true in recursive call |
without_transformation | specifies if we are not restructuring the code |
before | is true/false if we are computing types which must be declared before/after type |
Non pointer fields must be declared before structs, pointer fields can be declared after; in some cases they must be declared after (circular dependencies)
Here true is correct
Non pointer fields must be declared before structs, pointer fields can be declared after; in some cases they must be declared after (circular dependencies)
Here true is correct
Definition at line 1108 of file tree_helper.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_UNARY_EXPRESSION, CGetElements(), CGetFieldTypes(), CGetPointedType(), debug_level, DEBUG_LEVEL_PARANOIC, GET_CONST_NODE, tree_node::get_kind(), GetFunctionReturnType(), GetParameterTypes(), INDENT_DBG_MEX, IsAligned(), IsPointerType(), test_panda::parameters, STR, THROW_UNREACHABLE, and test_panda::type.
Referenced by GetTypesToBeDeclaredAfter(), and GetTypesToBeDeclaredBefore().
|
static |
return the qualifiers in C format
quals | store the token encoding the qualifiers |
real_const | is true when we need a real constant (e.g., const is not commented) |
Definition at line 4305 of file tree_helper.cpp.
References FIRST_TOKEN, STR, THROW_UNREACHABLE, TOK_QUAL_C, TOK_QUAL_CR, TOK_QUAL_CV, TOK_QUAL_CVR, TOK_QUAL_R, TOK_QUAL_V, and TOK_QUAL_VR.
Referenced by GimpleWriter::GimpleWriter(), BehavioralHelper::print_type_declaration(), and PrintType().
|
static |
return the prefix given a qualifier
quals | store the token encoding the qualifiers |
Definition at line 4271 of file tree_helper.cpp.
References STR, THROW_UNREACHABLE, TOK_QUAL_C, TOK_QUAL_CR, TOK_QUAL_CV, TOK_QUAL_CVR, TOK_QUAL_R, TOK_QUAL_V, and TOK_QUAL_VR.
Referenced by tree_manager::check_for_decl(), and tree_manager::check_for_type().
|
static |
Return the size of a tree object.
tn | is the tree object |
Definition at line 153 of file tree_helper.cpp.
References CASE_BINARY_EXPRESSION, CASE_CPP_NODES, CASE_FAKE_NODES, CASE_PRAGMA_NODES, CASE_TERNARY_EXPRESSION, CASE_UNARY_EXPRESSION, CGetType(), debug_level, DEBUG_LEVEL_PARANOIC, GET_CONST_NODE, tree_node::get_kind(), GetConstValue(), INDENT_DBG_MEX, IsRealType(), IsSignedIntegerType(), max, min, APInt::minBitwidth(), sign_reduce_bitstring(), STR, and THROW_UNREACHABLE.
Referenced by AccessedMaximumBitsize(), AccessedMinimunBitsize(), mux_connection_binding::add_conversion(), memory::add_internal_symbol(), fu_binding::add_to_SM(), mux_connection_binding::address_precision(), memory_allocation::allocate_parameters(), AllocatedMemorySize(), StorageValueInformation::are_value_bitsize_compatible(), operations_cfg_computation::build_operation_recursive(), minimal_interface::build_wrapper(), top_entity_parallel_cs::BW_loop_iter(), AllocationInformation::can_be_asynchronous_ram(), AllocationInformation::CanBeMerged(), lut_transformation::CHECK_BIN_EXPR_BOOL_SIZE(), lut_transformation::CHECK_BIN_EXPR_INT_SIZE(), lut_transformation::CHECK_COND_EXPR_SIZE(), lut_transformation::CHECK_NOT_EXPR_SIZE(), simple_code_motion::CheckMovable(), memory::compute_next_base_address(), CreateAddressTranslation::ComputeAddress(), mux_connection_binding::create_connections(), tree_manipulation::create_gimple_modify_stmt(), tree_manipulation::create_phi_node(), tree_manipulation::create_ternary_operation(), tree_manager::CreateUniqueIntegerCst(), DiscrepancyAnalysisCWriter::DeclareLocalVariables(), vcd_utility::detect_fixed_address_mismatch(), mux_connection_binding::determine_connection(), IR_lowering::division_by_a_constant(), TestbenchGeneration::Exec(), InterfaceInfer::Exec(), IR_lowering::expand_MC(), IR_lowering::expand_mult_const(), IR_lowering::expand_smod_pow2(), fu_binding::fill_array_ref_memory(), memory_allocation::finalize_memory_allocation(), get_array_dim_and_bitsize(), HLS_manager::get_constant_string(), WB4_interface::get_data_bus_bitsize(), get_data_bus_bitsize(), memory::get_last_address(), BehavioralHelper::get_size(), GetArrayDimensions(), GetArrayElementSize(), AllocationInformation::GetCondExprTimeLatency(), AllocationInformation::GetConnectionTime(), GetConstValue(), AllocationInformation::GetCycleLatency(), AllocationInformation::GetNodeTypePrec(), AllocationInformation::GetPhiConnectionLatency(), ComputeReservedMemory::GetReservedBytes(), AllocationInformation::GetStatementArea(), AllocationInformation::GetTimeLatency(), CSE::hash_check(), soft_float_cg_ext::int_type_for(), allocation::IntegrateTechnologyLibraries(), FixStructsPassedByValue::InternalExec(), BuiltinWaitCallModuleGenerator::InternalExec(), BuiltinWaitCallNModuleGenerator::InternalExec(), extract_patterns::InternalExec(), mem_dominator_allocation::InternalExec(), compute_implicit_calls::InternalExec(), dead_code_elimination::InternalExec(), IR_lowering::InternalExec(), soft_float_cg_ext::InternalExec(), allocation::InternalExec(), is_a_misaligned_vector(), IsSameType(), mux_connection_binding::object_bitsize(), Bit_Value_opt::optimize(), vcd_utility::print_discrepancy(), TestbenchGeneration::print_var_init(), BehavioralHelper::PrintNode(), PrintType(), MemoryInitializationCWriter::Process(), MemoryInitializationWriter::Process(), lut_transformation::ProcessBasicBlock(), Bit_Value_opt::propagateValue(), hls_div_cg_ext::recursive_examinate(), soft_float_cg_ext::RecursiveExaminate(), compute_implicit_calls::replace_with_memcpy(), compute_implicit_calls::replace_with_memset(), same_size_fields(), InterfaceInfer::setReadInterface(), InterfaceInfer::setWriteInterface(), soft_float_cg_ext::signature_lowering(), fu_binding::specialise_fu(), Vectorize::Transform(), InterfaceInfer::interface_info::update(), fu_binding::write_init(), CWriter::WriteBuiltinWaitCall(), DiscrepancyAnalysisCWriter::WriteExtraInitCode(), HLSCWriter::WriteMainTestbench(), and DiscrepancyAnalysisCWriter::writePostInstructionInfo().
|
static |
debug level (set by Parameter)
Definition at line 111 of file tree_helper.hpp.
Referenced by AllocatedMemorySize(), BambuParameter::CheckParameters(), compute_ssa_uses_rec_ptr(), ComputeSsaUses(), get_integer_cst_value(), GetConstValue(), use_counting::InternalExec(), PrintType(), RecursiveGetTypesToBeDeclared(), and Size().
|
staticprivate |
store the set of SystemC class for which the template parameter correspond to the bit size of the type
Definition at line 85 of file tree_helper.hpp.
|
staticprivate |
store the set of SystemC class for which the type correspond to the template parameter
Header include.
parser/compiler include STL include Tree include Utility include built in type without parameter "sc_in_resolved" is not a template and inherits from sc_in<sc_dt::sc_logic> "sc_inout_resolved" is not a template and inherits from sc_inout<sc_dt::sc_logic> "sc_out_resolved" is not a template and inherits from sc_inout_resolved "sc_in_clk" is not a template and is a typedef of sc_in<bool> "sc_out_clk" is not a template and is a typedef of sc_out<bool> "sc_inout_clk" is not a template and is a typedef of sc_inout<bool> builtin types with parameter "sc_lv" is a template, has a parameter (W) "sc_bv" is a template, has a parameter (W) "sc_in_rv" is a template, has a parameter (W) and inherits from sc_in<sc_dt::sc_lv<W> > "sc_out_rv" is a template, has a parameter (W) and inherits from sc_inout_rv<W> "sc_inout_rv" is a template, has a parameter (W) and inherits from sc_inout<sc_dt::sc_lv<W> > "sc_signal_rv" is a template, has a parameter (W) and inherits from sc_signal<sc_dt::sc_lv<W> > "sc_fifo_in" is a template, has a parameter (T) and inherits from sc_port<sc_fifo_in_if<T>,0> "sc_fifo_out" is a template, has a parameter (T) and inherits from sc_port<sc_fifo_out_if<T>,0>
Definition at line 82 of file tree_helper.hpp.
Referenced by GetTypeName().
|
staticprivate |
store the set of TLM SystemC class for which the size corresponds to the sum of the size of template parameters
Definition at line 88 of file tree_helper.hpp.