PandA-2024.02
|
#include <behavioral_helper.hpp>
Public Member Functions | |
BehavioralHelper (const application_managerRef AppM, unsigned int index, bool body, const ParameterConstRef parameters) | |
Constructor. More... | |
virtual | ~BehavioralHelper () |
Destructor. More... | |
virtual std::tuple< std::string, unsigned int, unsigned int > | get_definition (unsigned int index, bool &is_system) const |
Returns where the type index is defined. More... | |
std::string | print_vertex (const OpGraphConstRef g, const vertex v, const var_pp_functorConstRef vppf, const bool dot=false) const |
Print the operations corrisponding to the vertex. More... | |
virtual std::string | PrintInit (const tree_nodeConstRef &var, const var_pp_functorConstRef vppf) const |
Print the initialization part. More... | |
virtual std::string | print_attributes (unsigned int var, const var_pp_functorConstRef vppf, bool first=true) const |
Print the attributes associated to a variable. More... | |
std::string | PrintVariable (unsigned int var) const |
Print the name of the variable associated to the index. More... | |
void | InvaildateVariableName (const unsigned int index) |
Invalidate cached variable name. More... | |
virtual std::string | PrintConstant (const tree_nodeConstRef &var, const var_pp_functorConstRef vppf=var_pp_functorConstRef()) const |
Print the constant associated with var. More... | |
virtual std::string | print_type (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="") const |
Print a type and its variable in case var is not zero. More... | |
virtual std::string | print_type_declaration (unsigned int type) const |
Print the declaration of a non built-in type. More... | |
virtual unsigned long long | get_size (unsigned int var) const |
Return the size in bit of a C object. More... | |
std::string | get_function_name () const |
Return the name of the function. More... | |
std::string | GetMangledFunctionName () const |
unsigned int | get_function_index () const |
Return the index of the function. More... | |
unsigned int | GetFunctionReturnType (unsigned int function) const |
Return the index associated with the type of the return of the function. More... | |
virtual bool | is_bool (unsigned int index) const |
Return true if index is a variable or a type of type bool. More... | |
virtual bool | is_natural (unsigned int index) const |
Return true if index is a variable grater than or equal to zero. More... | |
virtual bool | is_int (unsigned int index) const |
Return true if index is a variable or a type of type int. More... | |
virtual bool | is_an_enum (unsigned int index) const |
Return true if index is a variable or a type of type enum. More... | |
virtual bool | is_unsigned (unsigned int index) const |
Return true if index is a variable or a type of type unsigned int. More... | |
virtual bool | is_real (unsigned int index) const |
Return true if index is a variable or a type of type real. More... | |
virtual bool | is_a_complex (unsigned int index) const |
Return true if index is a variable or a type of type complex. More... | |
virtual bool | is_a_struct (unsigned int variable) const |
Return true if index is a variable or a type of type struct. More... | |
virtual bool | is_an_union (unsigned int variable) const |
Return true if index is a variable of a type of type union. More... | |
virtual bool | is_an_array (unsigned int variable) const |
Return true if index is a variable or a type of type array. More... | |
bool | is_a_vector (unsigned int variable) const |
Return true if index is a variable or a type of type vector. More... | |
virtual bool | is_a_pointer (unsigned int variable) const |
Return true if index is a variable or a type of type pointer. More... | |
virtual bool | is_an_indirect_ref (unsigned int variable) const |
Return true if the index is an indirect ref. More... | |
virtual bool | is_an_array_ref (unsigned int variable) const |
Return true if the index is an array ref. More... | |
virtual bool | is_a_component_ref (unsigned int variable) const |
Return true if the index is a component ref. More... | |
virtual bool | is_an_addr_expr (unsigned int variable) const |
Return true if the index is an addr_expr. More... | |
virtual bool | is_a_mem_ref (unsigned int variable) const |
Return true if the index is a mem_ref. More... | |
virtual bool | is_static (unsigned int decl) const |
check if a given index is a static declaration More... | |
virtual bool | is_extern (unsigned int decl) const |
check if a given index is a extern declaration More... | |
virtual bool | is_a_constant (unsigned int obj) const |
Return true if the index is a constant object. More... | |
virtual bool | is_a_result_decl (unsigned int obj) const |
Return true if index is a result_decl. More... | |
virtual bool | is_a_realpart_expr (unsigned int obj) const |
Return true if index is a realpart_expr. More... | |
virtual bool | is_a_imagpart_expr (unsigned int obj) const |
Return true if index is a imagpart_expr. More... | |
virtual bool | is_operating_system_function (const unsigned int obj) const |
Return true if function is an operating system function. More... | |
virtual int unsigned | start_with_a_label (const blocRef &block) const |
Return the nodeID of the first statement of a basic block in case that statement is a label expression. More... | |
virtual unsigned int | end_with_a_cond_or_goto (const blocRef &block) const |
Return the nodeID of the last statement of a basic block in case that statement is a cond or a goto expression. More... | |
virtual unsigned int | get_indirect_ref_var (unsigned int obj) const |
Return the variable of an indirect ref. More... | |
virtual unsigned int | get_array_ref_array (unsigned int obj) const |
Return the array variable of an array ref. More... | |
virtual unsigned int | get_array_ref_index (unsigned int obj) const |
Return the index variable of an array ref. More... | |
virtual unsigned int | get_component_ref_record (unsigned int obj) const |
Return the record variable of a component ref. More... | |
virtual unsigned int | get_component_ref_field (unsigned int obj) const |
Return the field index of a component ref. More... | |
virtual unsigned int | get_mem_ref_base (unsigned int obj) const |
Return the base of a mem ref. More... | |
virtual unsigned int | get_mem_ref_offset (unsigned int obj) const |
Return the offset of a mem ref. More... | |
virtual unsigned int | get_operand_from_unary_expr (unsigned int obj) const |
Return the index of the operand if index is addr_expr, a realpart_expr or a imagpart_expr. More... | |
virtual unsigned int | GetVarFromSsa (unsigned int index) const |
Return the index of the variable base of a ssa var. More... | |
virtual unsigned int | get_intermediate_var (unsigned int obj) const |
Return the intermediate variable of an operation. More... | |
virtual unsigned int | get_type (const unsigned int var) const |
Return the type of the variable. More... | |
virtual unsigned int | get_pointed_type (const unsigned int type) const |
Return the pointed type of a pointer. More... | |
unsigned int | GetElements (const unsigned int type) const |
Given an array or a vector return the element type. More... | |
virtual TreeNodeConstSet | GetParameterTypes () const |
Returns the types of the parameters. More... | |
const std::list< unsigned int > | get_parameters () const |
Return the list of index of original parameters of the function. More... | |
std::vector< tree_nodeRef > | GetParameters () const |
Return the list of index of original parameters of the function. More... | |
bool | has_implementation () const |
Return true if function has implementation. More... | |
virtual bool | is_var_args () const |
Returns true if this function is of var args type. More... | |
virtual bool | is_va_start_call (unsigned int stm) const |
return true in case stm is a va_start call_expr More... | |
virtual unsigned int | GetInit (unsigned int var, CustomUnorderedSet< unsigned int > &list_of_variables) const |
return the initialization object associated with the variable. More... | |
virtual unsigned int | get_attributes (unsigned int var) const |
return the attributes associated with the variable. More... | |
virtual unsigned int | is_named_pointer (const unsigned int index) const |
return the nodeid of the named pointer (pointer_type with a name different More... | |
unsigned int | is_name_used (std::string var) const |
Return if a variable with this name already exists. More... | |
void | add_read_global_variable (unsigned int variable) |
Add a read of a global variable. More... | |
void | add_written_global_variable (unsigned int variable) |
Add a writing of a global variables. More... | |
CustomOrderedSet< unsigned int > | get_read_global_variables () const |
Get the global variables read by the correspondent function. More... | |
CustomOrderedSet< unsigned int > | get_written_global_variables () const |
Get the global variables written by the correspondent function. More... | |
void | add_initialization (unsigned int var, unsigned int init) |
Add the initialization of a variables. More... | |
virtual std::string | print_phinode_res (unsigned int phi_node_id, vertex v, const var_pp_functorConstRef vppf) const |
void | set_opaque () |
Set opaque flag to true. More... | |
void | set_not_opaque () |
Set opaque flag to false. More... | |
bool | get_opaque () const |
Return the opaque flag. More... | |
virtual const std::string | get_label_name (unsigned int label_expr_nid) const |
return the label name associated with the label expression More... | |
virtual std::string | print_forward_declaration (unsigned int type) const |
Print the declaration of a non built-in type. More... | |
virtual bool | is_empty_return (unsigned int index) const |
return true in case index is a return expr with an empty operand. More... | |
virtual std::string | PrintNode (const tree_nodeConstRef &node, vertex v, const var_pp_functorConstRef vppf) const |
Print the operations corresponding to the node. More... | |
virtual std::string | PrintNode (unsigned int node_id, vertex v, const var_pp_functorConstRef vppf) const |
std::string | PrintVarDeclaration (unsigned int var, const var_pp_functorConstRef vppf, bool init_has_to_be_printed) const |
This function prints the declaration of a variable without the closing ";". More... | |
unsigned int | GetUnqualified (const unsigned int index) const |
Return the unqualified version of a type. More... | |
virtual void | GetTypecast (const tree_nodeConstRef &tn, TreeNodeConstSet &types) const |
return the types used in type casting by tn More... | |
bool | IsDefaultSsaName (const unsigned int ssa_name_index) const |
Return true if node is the default ssa_name. More... | |
bool | function_has_to_be_printed (unsigned int f_id) const |
returns true if the function body has to be printed by the C backend More... | |
std::string | get_asm_string (const unsigned int node_index) const |
return the string associated with the gimple_asm More... | |
bool | CanBeSpeculated (const unsigned int node_index) const |
Return true if an operation can be speculated. More... | |
bool | CanBeMoved (const unsigned int node_index) const |
Return if an operation can be moved. More... | |
bool | IsStore (const unsigned int statement_index) const |
Return if an operation is a store. More... | |
bool | IsLoad (const unsigned int statement_index) const |
Return if an operation is a load. More... | |
bool | IsLut (const unsigned int statement_index) const |
Return if an operation is a lut_expr. More... | |
Static Public Member Functions | |
static void | rename_a_variable (unsigned int var, const std::string &new_name) |
rename a variable More... | |
static void | clear_renaming_table () |
remove all the entries from the renaming table More... | |
Protected Member Functions | |
bool | has_bit_field (unsigned int variable) const |
Return true if the variable is a field_decl and it has a bitfield. More... | |
Protected Attributes | |
const application_managerRef | AppM |
The application manager. More... | |
const tree_managerConstRef | TM |
The tree manager. More... | |
const ParameterConstRef | Param |
The set of input parameters. More... | |
int | debug_level |
the debug level More... | |
unsigned int | function_index |
Index of the function. More... | |
std::string | function_name |
Name of the function. More... | |
bool | body |
Flag to check if behavioral_graph_manager contains the function implementation. More... | |
bool | opaque |
Flag to check if a call to this function has to be treated as a TYPE_OPAQUE nodeID. More... | |
std::map< unsigned int, unsigned int > | initializations |
Structure which stores initializations. More... | |
Static Protected Attributes | |
static std::map< unsigned int, std::pair< std::string, int > > | definitions |
Maps between unqualified type and definition of a corresponding qualified type. More... | |
static std::map< std::string, unsigned int > | used_name |
Set of variables name already used. More... | |
static std::map< unsigned int, std::string > | vars_symbol_table |
The var symbol table. More... | |
static std::map< unsigned int, std::string > | vars_renaming_table |
Variable renaming table. More... | |
Definition at line 77 of file behavioral_helper.hpp.
BehavioralHelper::BehavioralHelper | ( | const application_managerRef | AppM, |
unsigned int | index, | ||
bool | body, | ||
const ParameterConstRef | parameters | ||
) |
Constructor.
AppM | is the application manager |
index | is the index of the function_decl |
body | specifies if function body is available |
parameters | is the set of input parameters |
Definition at line 88 of file behavioral_helper.cpp.
References ~BehavioralHelper().
|
virtualdefault |
void BehavioralHelper::add_initialization | ( | unsigned int | var, |
unsigned int | init | ||
) |
Add the initialization of a variables.
var | is the variable |
init | is the index of the initialization |
Definition at line 1132 of file behavioral_helper.cpp.
References init(), and initializations.
void BehavioralHelper::add_read_global_variable | ( | unsigned int | variable | ) |
Add a read of a global variable.
variable | is the global variable read |
void BehavioralHelper::add_written_global_variable | ( | unsigned int | variable | ) |
Add a writing of a global variables.
variable | is the global variable written |
bool BehavioralHelper::CanBeMoved | ( | const unsigned int | node_index | ) | const |
Return if an operation can be moved.
node_index | is the tree node index of the operation |
Definition at line 6516 of file behavioral_helper.cpp.
References tree_manager::CGetTreeNode(), ENTRY_ID, EXIT_ID, GET_INDEX_NODE, GET_NODE, tree_helper::name_function(), STR, THROW_ASSERT, and TM.
bool BehavioralHelper::CanBeSpeculated | ( | const unsigned int | node_index | ) | const |
Return true if an operation can be speculated.
node_index | is the tree node index of the operation |
This check must be done before check of load or store since predicated load nd predicated store can be speculated
Load cannot be speculated since load from not mapped addresses would not end
Call functions cannot be speculated because of possible effects not caught by virtuals in particular corner case (gcc-4.6 -O0 gcc_regression_simple/20070424-1.c)
Definition at line 6294 of file behavioral_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::CGetTreeNode(), debug_level, DEBUG_LEVEL_PARANOIC, ENTRY_ID, EXIT_ID, GET_NODE, INDENT_DBG_MEX, IsLoad(), IsStore(), STR, THROW_ASSERT, THROW_UNREACHABLE, and TM.
Referenced by SDCScheduling::AddDelayConstraints(), and SDCScheduling::InternalExec().
|
static |
remove all the entries from the renaming table
Definition at line 6231 of file behavioral_helper.cpp.
References vars_renaming_table.
Referenced by EdgeCWriter::writeRoutineInstructions_rec(), and CWriter::writeRoutineInstructions_rec().
|
virtual |
Return the nodeID of the last statement of a basic block in case that statement is a cond or a goto expression.
block | is basic block reference. |
Definition at line 6075 of file behavioral_helper.cpp.
References GET_INDEX_NODE, and GET_NODE.
Referenced by EdgeCWriter::writeRoutineInstructions_rec(), and CWriter::writeRoutineInstructions_rec().
bool BehavioralHelper::function_has_to_be_printed | ( | unsigned int | f_id | ) | const |
returns true if the function body has to be printed by the C backend
Definition at line 6276 of file behavioral_helper.cpp.
References function_name, tree_helper::is_system(), tree_helper::IsInLibbambu(), and TM.
Referenced by VcdSignalSelection::CrossPropagateAddrSsa(), and DiscrepancyAnalysisCWriter::writePreInstructionInfo().
|
virtual |
Return the array variable of an array ref.
index | is an indirect_ref object. |
Definition at line 5470 of file behavioral_helper.cpp.
References GET_INDEX_NODE, tree_manager::get_tree_node_const(), is_an_array_ref(), THROW_ASSERT, and TM.
Referenced by prettyPrintVertex::get_internal_vars(), std_var_pp_functor::operator()(), pointer_var_pp_functor::operator()(), and isolated_var_pp_functor::operator()().
|
virtual |
Return the index variable of an array ref.
index | is an indirect_ref object. |
Definition at line 5478 of file behavioral_helper.cpp.
References GET_INDEX_NODE, tree_manager::get_tree_node_const(), is_an_array_ref(), THROW_ASSERT, and TM.
Referenced by std_var_pp_functor::operator()(), pointer_var_pp_functor::operator()(), and isolated_var_pp_functor::operator()().
std::string BehavioralHelper::get_asm_string | ( | const unsigned int | node_index | ) | const |
return the string associated with the gimple_asm
node_index | is the gimple_asm node id |
Definition at line 6289 of file behavioral_helper.cpp.
References tree_helper::get_asm_string(), and TM.
|
virtual |
return the attributes associated with the variable.
var | is the index of variable |
Definition at line 5860 of file behavioral_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_TYPE_NODES, CASE_UNARY_EXPRESSION, GET_INDEX_NODE, tree_node::get_kind(), tree_node::get_kind_text(), tree_manager::get_tree_node_const(), STR, THROW_ASSERT, THROW_ERROR, and TM.
Referenced by PrintVarDeclaration().
|
virtual |
Return the field index of a component ref.
index | is an component_ref object. |
Definition at line 5494 of file behavioral_helper.cpp.
References GET_INDEX_NODE, tree_manager::get_tree_node_const(), is_a_component_ref(), THROW_ASSERT, and TM.
Referenced by std_var_pp_functor::operator()(), pointer_var_pp_functor::operator()(), and isolated_var_pp_functor::operator()().
|
virtual |
Return the record variable of a component ref.
index | is a component_ref object. |
Definition at line 5486 of file behavioral_helper.cpp.
References GET_INDEX_NODE, tree_manager::get_tree_node_const(), is_a_component_ref(), THROW_ASSERT, and TM.
Referenced by prettyPrintVertex::get_internal_vars(), std_var_pp_functor::operator()(), pointer_var_pp_functor::operator()(), and isolated_var_pp_functor::operator()().
|
virtual |
Returns where the type index is defined.
index | is the index typedef |
bool | tells if the type hype has been already recognized as system |
Definition at line 103 of file behavioral_helper.cpp.
References tree_manager::CGetTreeReindex(), tree_helper::GetSourcePath(), THROW_ASSERT, and TM.
Referenced by CheckSystemType::recursive_examinate().
unsigned int BehavioralHelper::get_function_index | ( | ) | const |
Return the index of the function.
function_name | is the name of the function |
Definition at line 1042 of file behavioral_helper.cpp.
References function_index.
Referenced by classic_datapath::add_ports(), ModuleGeneratorManager::create_generic_module(), DiscrepancyAnalysisCWriter::DeclareLocalVariables(), CWriter::DeclareLocalVariables(), ModuleGeneratorManager::specialize_fu(), DiscrepancyAnalysisCWriter::writePostInstructionInfo(), EdgeCWriter::writeRoutineInstructions(), EdgeCWriter::writeRoutineInstructions_rec(), CWriter::writeRoutineInstructions_rec(), and HLSCWriter::WriteTestbenchFunctionCall().
std::string BehavioralHelper::get_function_name | ( | ) | const |
Return the name of the function.
Definition at line 1032 of file behavioral_helper.cpp.
References function_name.
Referenced by determine_memory_accesses::analyze_node(), OpGraph::CGetOutEdges(), DataDependenceComputation::Computedependencies(), VcdSignalSelection::CrossPropagateAddrSsa(), CWriter::DeclareLocalVariables(), CWriter::DeclareType(), Loops::DetectLoops(), Evaluation::Exec(), pipeline_controller::InternalExec(), FSM_NI_SSA_liveness::InternalExec(), fsm_controller::InternalExec(), TasteInterfaceGeneration::InternalExec(), top_entity_parallel_cs::InternalExec(), ControlFlowChecker::InternalExec(), AddBbEcfgEdges::InternalExec(), bb_feedback_edges_computation::InternalExec(), dom_post_dom_computation::InternalExec(), NI_SSA_liveness::InternalExec(), operations_cfg_computation::InternalExec(), SDCScheduling::InternalExec(), parametric_list_based::InternalExec(), cdfc_module_binding::InternalExec(), Schedule::WriteDot(), OpGraph::WriteDot(), CWriter::WriteFunctionBody(), CWriter::WriteHeader(), HLSCWriter::WriteParamDecl(), DiscrepancyAnalysisCWriter::writePostInstructionInfo(), EdgeCWriter::writeRoutineInstructions(), and HLSCWriter::WriteTestbenchFunctionCall().
|
virtual |
Return the variable of an indirect ref.
index | is an indirect_ref object. |
Definition at line 5457 of file behavioral_helper.cpp.
References GET_INDEX_NODE, tree_manager::get_tree_node_const(), is_an_indirect_ref(), THROW_ASSERT, and TM.
Referenced by prettyPrintVertex::get_internal_vars(), and pointer_var_pp_functor::operator()().
|
virtual |
Return the intermediate variable of an operation.
It returns 0 when there is not an intermediate variable.
index | is an operation. |
check for type conversion
Definition at line 5541 of file behavioral_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_INDEX_NODE, tree_node::get_kind(), GET_NODE, tree_manager::get_tree_node_const(), and TM.
Referenced by prettyPrintVertex::get_internal_vars().
|
virtual |
return the label name associated with the label expression
Definition at line 6064 of file behavioral_helper.cpp.
References GET_NODE, tree_manager::get_tree_node_const(), THROW_ASSERT, and TM.
Referenced by EdgeCWriter::writeRoutineInstructions().
|
virtual |
Return the base of a mem ref.
index | is a mem_ref object. |
Definition at line 5502 of file behavioral_helper.cpp.
References GET_INDEX_NODE, tree_manager::get_tree_node_const(), is_a_mem_ref(), THROW_ASSERT, and TM.
Referenced by std_var_pp_functor::operator()(), and isolated_var_pp_functor::operator()().
|
virtual |
Return the offset of a mem ref.
index | is a mem_ref object. |
Definition at line 5510 of file behavioral_helper.cpp.
References GET_INDEX_NODE, tree_manager::get_tree_node_const(), is_a_mem_ref(), THROW_ASSERT, and TM.
Referenced by std_var_pp_functor::operator()(), and isolated_var_pp_functor::operator()().
bool BehavioralHelper::get_opaque | ( | ) | const |
Return the opaque flag.
Definition at line 1147 of file behavioral_helper.cpp.
References opaque.
|
virtual |
Return the index of the operand if index is addr_expr, a realpart_expr or a imagpart_expr.
index | is the index of the expression |
Definition at line 5518 of file behavioral_helper.cpp.
References GET_INDEX_NODE, tree_manager::get_tree_node_const(), is_a_imagpart_expr(), is_a_realpart_expr(), is_an_addr_expr(), STR, THROW_ASSERT, and TM.
Referenced by prettyPrintVertex::get_internal_vars(), std_var_pp_functor::operator()(), pointer_var_pp_functor::operator()(), and isolated_var_pp_functor::operator()().
const std::list< unsigned int > BehavioralHelper::get_parameters | ( | ) | const |
Return the list of index of original parameters of the function.
Definition at line 1060 of file behavioral_helper.cpp.
References tree_manager::CGetTreeNode(), debug_level, DEBUG_LEVEL_PARANOIC, fun(), function_index, GET_CONST_NODE, GET_INDEX_CONST_NODE, GET_INDEX_NODE, GET_NODE, INDENT_DBG_MEX, test_panda::parameters, STR, and TM.
Referenced by classic_datapath::add_ports(), datapath_parallel_cs::connect_module_kernel(), and CWriter::DeclareLocalVariables().
|
virtual |
Return the pointed type of a pointer.
type | is a pointer object |
Definition at line 1157 of file behavioral_helper.cpp.
References tree_helper::CGetPointedType(), tree_manager::CGetTreeReindex(), index, and TM.
CustomOrderedSet<unsigned int> BehavioralHelper::get_read_global_variables | ( | ) | const |
Get the global variables read by the correspondent function.
|
virtual |
Return the size in bit of a C object.
index | is the index of a C object |
Definition at line 1027 of file behavioral_helper.cpp.
References tree_manager::CGetTreeReindex(), tree_helper::Size(), and TM.
Referenced by structural_type_descriptor::structural_type_descriptor().
|
virtual |
Return the type of the variable.
var | is the index of variable |
Definition at line 1152 of file behavioral_helper.cpp.
References tree_helper::get_type_index(), and TM.
Referenced by is_a_complex(), is_a_struct(), is_a_vector(), is_an_array(), is_an_enum(), is_an_union(), is_bool(), is_int(), is_real(), is_unsigned(), std_var_pp_functor::operator()(), isolated_var_pp_functor::operator()(), and structural_type_descriptor::structural_type_descriptor().
CustomOrderedSet<unsigned int> BehavioralHelper::get_written_global_variables | ( | ) | const |
Get the global variables written by the correspondent function.
unsigned int BehavioralHelper::GetElements | ( | const unsigned int | type | ) | const |
Given an array or a vector return the element type.
index | is the type of the array |
Definition at line 1162 of file behavioral_helper.cpp.
References tree_helper::CGetElements(), tree_manager::CGetTreeReindex(), index, and TM.
Referenced by structural_type_descriptor::structural_type_descriptor().
unsigned int BehavioralHelper::GetFunctionReturnType | ( | unsigned int | function | ) | const |
Return the index associated with the type of the return of the function.
function_is | is the index of the function |
Definition at line 1047 of file behavioral_helper.cpp.
References tree_manager::CGetTreeReindex(), tree_helper::GetFunctionReturnType(), tree_node::index, and TM.
Referenced by classic_datapath::add_ports(), VcdSignalSelection::SelectAddrSsa(), and HLSCWriter::WriteTestbenchFunctionCall().
|
virtual |
return the initialization object associated with the variable.
var | is the index of variable |
list_of_variables | is used to return list of variables used during initialization |
Definition at line 5918 of file behavioral_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_TYPE_NODES, CASE_UNARY_EXPRESSION, debug_level, DEBUG_LEVEL_PARANOIC, GET_INDEX_NODE, tree_node::get_kind(), tree_node::get_kind_text(), tree_manager::get_tree_node_const(), tree_helper::get_used_variables(), INDENT_DBG_MEX, init(), initializations, PrintVariable(), STR, THROW_UNREACHABLE, and TM.
Referenced by CWriter::DeclareVariable(), and PrintVarDeclaration().
std::string BehavioralHelper::GetMangledFunctionName | ( | ) | const |
Definition at line 1037 of file behavioral_helper.cpp.
References tree_manager::CGetTreeNode(), function_index, tree_helper::GetMangledFunctionName(), and TM.
Referenced by HLSCWriter::WriteParamInitialization(), and HLSCWriter::WriteTestbenchFunctionCall().
std::vector< tree_nodeRef > BehavioralHelper::GetParameters | ( | ) | const |
Return the list of index of original parameters of the function.
Definition at line 1097 of file behavioral_helper.cpp.
References tree_manager::CGetTreeNode(), debug_level, DEBUG_LEVEL_PARANOIC, fun(), function_index, GET_CONST_NODE, GET_INDEX_CONST_NODE, INDENT_DBG_MEX, test_panda::parameters, STR, and TM.
Referenced by DiscrepancyAnalysisCWriter::DeclareLocalVariables(), HLSCWriter::WriteParamDecl(), HLSCWriter::WriteParamInitialization(), and HLSCWriter::WriteTestbenchFunctionCall().
|
virtual |
Returns the types of the parameters.
Definition at line 5741 of file behavioral_helper.cpp.
References test_panda::arg, tree_manager::CGetTreeNode(), function_index, GET_CONST_NODE, and TM.
|
virtual |
return the types used in type casting by tn
tn | is the statement analyzed |
types | is the set of types type-casted by tn |
Definition at line 6236 of file behavioral_helper.cpp.
References tree_node::visit().
unsigned int BehavioralHelper::GetUnqualified | ( | const unsigned int | index | ) | const |
Return the unqualified version of a type.
type | is the type |
Definition at line 6213 of file behavioral_helper.cpp.
References tree_helper::GetUnqualified(), and TM.
Referenced by structural_type_descriptor::structural_type_descriptor().
|
virtual |
Return the index of the variable base of a ssa var.
index | is the index of the ssa var |
Definition at line 5527 of file behavioral_helper.cpp.
References GET_INDEX_NODE, tree_manager::get_tree_node_const(), index, and TM.
Referenced by pointer_var_pp_functor::operator()().
|
protected |
Return true if the variable is a field_decl and it has a bitfield.
Definition at line 5839 of file behavioral_helper.cpp.
References tree_node::get_kind(), tree_manager::get_tree_node_const(), TM, and TOK_BITFIELD.
Referenced by print_type_declaration(), and PrintNode().
bool BehavioralHelper::has_implementation | ( | ) | const |
Return true if function has implementation.
Definition at line 1127 of file behavioral_helper.cpp.
References body.
Referenced by VcdSignalSelection::CrossPropagateAddrSsa(), and DiscrepancyAnalysisCWriter::writePreInstructionInfo().
void BehavioralHelper::InvaildateVariableName | ( | const unsigned int | index | ) |
Invalidate cached variable name.
index | is the variable whose name must be invalidated |
Definition at line 6577 of file behavioral_helper.cpp.
References vars_symbol_table.
|
virtual |
Return true if index is a variable or a type of type complex.
Definition at line 5203 of file behavioral_helper.cpp.
References get_type(), tree_helper::is_a_complex(), and TM.
Referenced by structural_type_descriptor::structural_type_descriptor().
|
virtual |
Return true if the index is a component ref.
index | is the index |
Definition at line 5259 of file behavioral_helper.cpp.
References tree_manager::CGetTreeNode(), and TM.
Referenced by get_component_ref_field(), get_component_ref_record(), prettyPrintVertex::get_internal_vars(), std_var_pp_functor::operator()(), pointer_var_pp_functor::operator()(), and isolated_var_pp_functor::operator()().
|
virtual |
Return true if the index is a constant object.
index | is a nodeID. |
Definition at line 5308 of file behavioral_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, tree_manager::CGetTreeNode(), GET_INDEX_NODE, and TM.
Referenced by prettyPrintVertex::get_internal_vars(), PrintConstant(), and PrintVariable().
|
virtual |
Return true if index is a imagpart_expr.
index | is the index of the node |
Definition at line 5433 of file behavioral_helper.cpp.
References tree_node::get_kind(), tree_manager::get_tree_node_const(), and TM.
Referenced by get_operand_from_unary_expr(), std_var_pp_functor::operator()(), pointer_var_pp_functor::operator()(), and isolated_var_pp_functor::operator()().
|
virtual |
Return true if the index is a mem_ref.
index | is the index |
Definition at line 5285 of file behavioral_helper.cpp.
References tree_manager::CGetTreeNode(), and TM.
Referenced by get_mem_ref_base(), get_mem_ref_offset(), std_var_pp_functor::operator()(), and isolated_var_pp_functor::operator()().
|
virtual |
Return true if index is a variable or a type of type pointer.
Definition at line 5228 of file behavioral_helper.cpp.
References tree_helper::is_a_pointer(), and TM.
Referenced by structural_type_descriptor::structural_type_descriptor().
|
virtual |
Return true if index is a realpart_expr.
index | is the index of the node |
Definition at line 5420 of file behavioral_helper.cpp.
References tree_node::get_kind(), tree_manager::get_tree_node_const(), and TM.
Referenced by get_operand_from_unary_expr(), std_var_pp_functor::operator()(), pointer_var_pp_functor::operator()(), and isolated_var_pp_functor::operator()().
|
virtual |
Return true if index is a result_decl.
Definition at line 5407 of file behavioral_helper.cpp.
References tree_node::get_kind(), tree_manager::get_tree_node_const(), and TM.
|
virtual |
Return true if index is a variable or a type of type struct.
Definition at line 5208 of file behavioral_helper.cpp.
References get_type(), tree_helper::is_a_struct(), and TM.
Referenced by std_var_pp_functor::operator()(), pointer_var_pp_functor::operator()(), address_var_pp_functor::operator()(), isolated_var_pp_functor::operator()(), and structural_type_descriptor::structural_type_descriptor().
bool BehavioralHelper::is_a_vector | ( | unsigned int | variable | ) | const |
Return true if index is a variable or a type of type vector.
Definition at line 5223 of file behavioral_helper.cpp.
References get_type(), tree_helper::is_a_vector(), and TM.
Referenced by structural_type_descriptor::structural_type_descriptor().
|
virtual |
Return true if the index is an addr_expr.
index | is the index |
Definition at line 5272 of file behavioral_helper.cpp.
References tree_manager::CGetTreeNode(), and TM.
Referenced by prettyPrintVertex::get_internal_vars(), get_operand_from_unary_expr(), std_var_pp_functor::operator()(), pointer_var_pp_functor::operator()(), and isolated_var_pp_functor::operator()().
|
virtual |
Return true if index is a variable or a type of type array.
Definition at line 5218 of file behavioral_helper.cpp.
References get_type(), tree_helper::is_an_array(), and TM.
Referenced by std_var_pp_functor::operator()(), pointer_var_pp_functor::operator()(), address_var_pp_functor::operator()(), isolated_var_pp_functor::operator()(), and structural_type_descriptor::structural_type_descriptor().
|
virtual |
Return true if the index is an array ref.
index | is a variable. |
Definition at line 5246 of file behavioral_helper.cpp.
References tree_manager::CGetTreeNode(), and TM.
Referenced by get_array_ref_array(), get_array_ref_index(), prettyPrintVertex::get_internal_vars(), std_var_pp_functor::operator()(), pointer_var_pp_functor::operator()(), and isolated_var_pp_functor::operator()().
|
virtual |
Return true if index is a variable or a type of type enum.
Definition at line 5189 of file behavioral_helper.cpp.
References get_type(), tree_helper::is_an_enum(), and TM.
|
virtual |
Return true if the index is an indirect ref.
index | is a variable. |
Definition at line 5233 of file behavioral_helper.cpp.
References tree_manager::CGetTreeNode(), and TM.
Referenced by get_indirect_ref_var(), prettyPrintVertex::get_internal_vars(), std_var_pp_functor::operator()(), pointer_var_pp_functor::operator()(), and isolated_var_pp_functor::operator()().
|
virtual |
Return true if index is a variable of a type of type union.
index | is the index of the variable or of the type |
Definition at line 5213 of file behavioral_helper.cpp.
References get_type(), tree_helper::is_an_union(), and TM.
Referenced by std_var_pp_functor::operator()(), pointer_var_pp_functor::operator()(), address_var_pp_functor::operator()(), isolated_var_pp_functor::operator()(), and structural_type_descriptor::structural_type_descriptor().
|
virtual |
Return true if index is a variable or a type of type bool.
Definition at line 5174 of file behavioral_helper.cpp.
References get_type(), tree_helper::is_bool(), and TM.
Referenced by structural_type_descriptor::structural_type_descriptor().
|
virtual |
return true in case index is a return expr with an empty operand.
Definition at line 6205 of file behavioral_helper.cpp.
References tree_manager::CGetTreeNode(), THROW_ASSERT, and TM.
|
virtual |
check if a given index is a extern declaration
decl | is the decl index id |
Definition at line 5303 of file behavioral_helper.cpp.
References tree_helper::is_extern(), and TM.
|
virtual |
Return true if index is a variable or a type of type int.
Definition at line 5184 of file behavioral_helper.cpp.
References get_type(), tree_helper::is_int(), and TM.
Referenced by structural_type_descriptor::structural_type_descriptor().
unsigned int BehavioralHelper::is_name_used | ( | std::string | var | ) | const |
Return if a variable with this name already exists.
var | is the name of the variable |
|
virtual |
return the nodeid of the named pointer (pointer_type with a name different
index | is the index of the variable or the index of the type |
Definition at line 5776 of file behavioral_helper.cpp.
References tree_manager::CGetTreeReindex(), tree_helper::CGetType(), GET_CONST_NODE, GET_INDEX_CONST_NODE, GET_INDEX_NODE, STR, THROW_ASSERT, TM, and test_panda::type.
|
virtual |
Return true if index is a variable grater than or equal to zero.
Definition at line 5179 of file behavioral_helper.cpp.
References tree_helper::is_natural(), and TM.
|
virtual |
Return true if function is an operating system function.
index | is the index of the node |
Definition at line 5446 of file behavioral_helper.cpp.
References tree_manager::get_tree_node_const(), decl_node::operating_system_flag, and TM.
Referenced by VcdSignalSelection::CrossPropagateAddrSsa().
|
virtual |
Return true if index is a variable or a type of type real.
Definition at line 5198 of file behavioral_helper.cpp.
References get_type(), tree_helper::is_real(), and TM.
Referenced by structural_type_descriptor::structural_type_descriptor().
|
virtual |
check if a given index is a static declaration
decl | is the decl index id |
Definition at line 5298 of file behavioral_helper.cpp.
References tree_helper::is_static(), and TM.
|
virtual |
Return true if index is a variable or a type of type unsigned int.
Definition at line 5193 of file behavioral_helper.cpp.
References get_type(), tree_helper::is_unsigned(), and TM.
Referenced by structural_type_descriptor::structural_type_descriptor().
|
virtual |
return true in case stm is a va_start call_expr
stm | is the statement |
Definition at line 5801 of file behavioral_helper.cpp.
References tree_node::get_kind(), GET_NODE, tree_manager::get_tree_node_const(), is_var_args(), tree_helper::print_function_name(), and TM.
|
virtual |
Returns true if this function is of var args type.
Definition at line 1212 of file behavioral_helper.cpp.
References function_index, tree_node::get_kind(), GET_NODE, tree_manager::get_tree_node_const(), THROW_ASSERT, TM, and test_panda::type.
Referenced by VcdSignalSelection::CrossPropagateAddrSsa(), and is_va_start_call().
bool BehavioralHelper::IsDefaultSsaName | ( | const unsigned int | ssa_name_index | ) | const |
Return true if node is the default ssa_name.
Definition at line 6242 of file behavioral_helper.cpp.
References function_index, tree_manager::get_tree_node_const(), and TM.
Referenced by pointer_var_pp_functor::operator()().
bool BehavioralHelper::IsLoad | ( | const unsigned int | statement_index | ) | const |
Return if an operation is a load.
statement_index | is the index of the tree node |
Definition at line 6566 of file behavioral_helper.cpp.
References AppM, tree_manager::CGetTreeReindex(), function_index, tree_helper::IsLoad(), and TM.
Referenced by CanBeSpeculated().
bool BehavioralHelper::IsLut | ( | const unsigned int | statement_index | ) | const |
Return if an operation is a lut_expr.
statement_index | is the index of the tree node |
Definition at line 6572 of file behavioral_helper.cpp.
References tree_manager::CGetTreeReindex(), tree_helper::IsLut(), and TM.
bool BehavioralHelper::IsStore | ( | const unsigned int | statement_index | ) | const |
Return if an operation is a store.
statement_index | is the index of the tree node |
Definition at line 6560 of file behavioral_helper.cpp.
References AppM, tree_manager::CGetTreeReindex(), function_index, tree_helper::IsStore(), and TM.
Referenced by CanBeSpeculated().
|
virtual |
Print the attributes associated to a variable.
index | is the attribute node |
vppf | is the functor used to dump the variable var. |
Definition at line 494 of file behavioral_helper.cpp.
References tree_manager::CGetTreeNode(), GET_CONST_NODE, GET_INDEX_NODE, GET_NODE, PrintConstant(), PrintVariable(), THROW_ERROR, and TM.
Referenced by PrintVarDeclaration().
|
virtual |
Print the declaration of a non built-in type.
type | is an object type. |
Definition at line 6105 of file behavioral_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, tree_manager::CGetTreeNode(), tree_helper::PrintType(), STR, THROW_ERROR, and TM.
Referenced by prettyPrintVertex::print_forward_declaration().
|
virtual |
Definition at line 6029 of file behavioral_helper.cpp.
References tree_manager::CGetTreeNode(), phi, PrintNode(), THROW_ASSERT, and TM.
|
virtual |
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 6218 of file behavioral_helper.cpp.
References tree_manager::CGetTreeReindex(), tree_helper::PrintType(), and TM.
Referenced by classic_datapath::add_ports(), std_var_pp_functor::operator()(), isolated_var_pp_functor::operator()(), and structural_type_descriptor::structural_type_descriptor().
|
virtual |
Print the declaration of a non built-in type.
type | is an object type. |
Print the contents of the structure
Print the contents of the structure
Compute the dimensions
NOTE: this case cannot be moved because of break absence
Definition at line 4816 of file behavioral_helper.cpp.
References C_EC, 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, tree_manager::CGetTreeNode(), tree_manager::CGetTreeReindex(), tree_helper::CGetType(), debug_level, DEBUG_LEVEL_PARANOIC, GET_CONST_NODE, GET_INDEX_NODE, GET_NODE, tree_helper::GetConstValue(), tree_helper::GetRealType(), has_bit_field(), INDENT_DBG_MEX, Param, PrintConstant(), tree_helper::PrintType(), tree_helper::return_C_qualifiers(), STR, THROW_ASSERT, THROW_ERROR_CODE, THROW_UNREACHABLE, and TM.
Referenced by CWriter::DeclareType().
std::string BehavioralHelper::print_vertex | ( | const OpGraphConstRef | g, |
const vertex | v, | ||
const var_pp_functorConstRef | vppf, | ||
const bool | dot = false |
||
) | const |
Print the operations corrisponding to the vertex.
g | is the graph |
v | is the vertex |
vppf | is the functor used to dump the variable var. |
dot | tells if the output is a dot graph |
Definition at line 110 of file behavioral_helper.cpp.
References CASE_BINARY_EXPRESSION, CASE_CPP_NODES, CASE_CST_NODES, CASE_DECL_NODES, CASE_FAKE_NODES, CASE_PRAGMA_NODES, CASE_QUATERNARY_EXPRESSION, CASE_TERNARY_EXPRESSION, CASE_TYPE_NODES, CASE_UNARY_EXPRESSION, OpGraph::CGetOpNodeInfo(), GET_CONST_NODE, and PrintNode().
Referenced by StateInfo::print(), and InstructionWriter::write().
|
virtual |
Print the constant associated with var.
var | is the constant tree node |
vppf | is the functor used to dump the variable var. |
long double
double
float
FIXME: float can not be used for imaginary part of complex number
Definition at line 648 of file behavioral_helper.cpp.
References C_EC, CASE_BINARY_EXPRESSION, CASE_CPP_NODES, CASE_FAKE_NODES, CASE_GIMPLE_NODES, CASE_PRAGMA_NODES, CASE_QUATERNARY_EXPRESSION, CASE_TERNARY_EXPRESSION, CASE_TYPE_NODES, debug_level, DEBUG_LEVEL_PARANOIC, default_COND, GET_CONST_NODE, GET_INDEX_NODE, tree_node::get_kind(), GET_NODE, tree_helper::GetConstValue(), INDENT_DBG_MEX, is_a_constant(), tree_helper::IsRealType(), tree_helper::IsSystemType(), tree_helper::print_function_name(), tree_helper::PrintType(), PrintVariable(), STR, THROW_ASSERT, THROW_ERROR, THROW_ERROR_CODE, TM, test_panda::type, and symmetry::value.
Referenced by print_attributes(), print_type_declaration(), PrintInit(), PrintNode(), PrintVariable(), EdgeCWriter::writeRoutineInstructions_rec(), and CWriter::writeRoutineInstructions_rec().
|
virtual |
Print the initialization part.
var | is the initialization expression. |
vppf | is the functor used to dump the variable var. |
check if designated initializers are really needed
Definition at line 198 of file behavioral_helper.cpp.
References CASE_CPP_NODES, CASE_FAKE_NODES, CASE_GIMPLE_NODES, CASE_PRAGMA_NODES, CASE_QUATERNARY_EXPRESSION, CASE_TERNARY_EXPRESSION, CASE_TYPE_NODES, GET_CONST_NODE, GET_INDEX_NODE, tree_node::get_kind(), MAX_ROW_LENGTH, NULL_VERTEX, tree_helper::print_function_name(), PrintConstant(), PrintNode(), PrintVariable(), STR, THROW_ASSERT, THROW_ERROR, and TM.
Referenced by PrintNode(), and PrintVarDeclaration().
|
virtual |
Print the operations corresponding to the node.
node | is the node to print |
v | is the vertex of the operation |
vppf | is the functor used to dump the variable var. The stream on which string is printed is the one associate with the identer |
check possible pointer arithmetic reverse
&string[0]
&array is printed back as array
check for type conversion
check for type conversion
check for type conversion
__builtin_va_start should be ad-hoc managed
Print parameters.
This pattern is for gcc 4.5
This pattern is for gcc 4.6
__builtin_va_start should be ad-hoc managed
Print parameters.
now print clauses
now print clauses
now print clauses
now print clauses
Definition at line 1226 of file behavioral_helper.cpp.
References AppM, BITFIELD_EC, C_EC, CASE_BINARY_EXPRESSION, CASE_CPP_NODES, CASE_CST_NODES, CASE_DECL_NODES, CASE_FAKE_NODES, CASE_GIMPLE_NODES, CASE_NON_ADDR_UNARY_EXPRESSION, CASE_PRAGMA_NODES, CASE_QUATERNARY_EXPRESSION, CASE_TERNARY_EXPRESSION, CASE_TYPE_NODES, CASE_UNARY_EXPRESSION, tree_helper::CGetElements(), tree_helper::CGetPointedType(), tree_helper::CGetType(), debug_level, DEBUG_LEVEL_PARANOIC, tree_helper::find_obj_type_ref_function(), GET_CONST_NODE, GET_INDEX_CONST_NODE, GET_INDEX_NODE, tree_node::get_kind(), GET_NODE, tree_helper::GetConstValue(), tree_helper::GetFunctionReturnType(), tree_manipulation::GetPointerType(), tree_helper::GetRealType(), tree_helper::GetTypeName(), has_bit_field(), INDENT_DBG_MEX, tree_helper::IsArrayType(), tree_helper::IsFunctionPointerType(), tree_helper::IsPointerType(), tree_helper::IsSignedIntegerType(), tree_helper::IsStructType(), tree_helper::IsUnionType(), tree_helper::IsUnsignedIntegerType(), tree_helper::IsVectorType(), tree_helper::IsVoidType(), k, offset, tree_helper::op_symbol(), Param, tree_helper::print_function_name(), PrintConstant(), PrintInit(), tree_helper::PrintType(), PrintVariable(), tree_helper::Size(), STR, STR_CST_pragma_keyword_call_hw, STR_CST_pragma_keyword_call_point_hw, STR_CST_pragma_keyword_map, STR_CST_pragma_keyword_recursive, STR_CST_string_sizeof, THROW_ASSERT, THROW_ERROR, THROW_ERROR_CODE, THROW_UNREACHABLE, TM, and test_panda::type.
Referenced by TransitionInfo::print(), print_phinode_res(), print_vertex(), PrintInit(), and PrintNode().
|
virtual |
Definition at line 1220 of file behavioral_helper.cpp.
References tree_manager::CGetTreeNode(), PrintNode(), and TM.
std::string BehavioralHelper::PrintVarDeclaration | ( | unsigned int | var, |
const var_pp_functorConstRef | vppf, | ||
bool | init_has_to_be_printed | ||
) | const |
This function prints the declaration of a variable without the closing ";".
For example the function prints on the stream os the following piece of C code:
* MYINT a *
when the variable var is equal to 4(a) and the vppf is an instance of std_var_pp_functor.
var | is the considered variable. |
vppf | is the functor used to dump the variable var. |
init_has_to_be_printed | tells if the init has to be printed |
If it is not a decl node (then it is an ssa-name) or it's a not system decl_node
Definition at line 1167 of file behavioral_helper.cpp.
References tree_manager::CGetTreeNode(), tree_manager::CGetTreeReindex(), tree_helper::CGetType(), get_attributes(), GET_CONST_NODE, GetInit(), init(), tree_helper::IsInLibbambu(), print_attributes(), PrintInit(), tree_helper::PrintType(), STR, THROW_ASSERT, and TM.
Referenced by CWriter::DeclareVariable().
std::string BehavioralHelper::PrintVariable | ( | unsigned int | var | ) | const |
Print the name of the variable associated to the index.
index | is the considered variable. |
Definition at line 534 of file behavioral_helper.cpp.
References AppM, tree_manager::CGetTreeNode(), default_COND, GET_CONST_NODE, GET_INDEX_NODE, GET_NODE, tree_helper::GetConstValue(), tree_manipulation::GetPointerType(), INTERNAL, is_a_constant(), tree_helper::NormalizeTypename(), offset, Param, tree_helper::print_function_name(), PrintConstant(), tree_helper::PrintType(), STR, THROW_ASSERT, TM, vars_renaming_table, and vars_symbol_table.
Referenced by classic_datapath::add_ports(), determine_memory_accesses::analyze_node(), top_entity_parallel_cs::connect_loop_iter(), datapath_parallel_cs::connect_module_kernel(), DiscrepancyAnalysisCWriter::DeclareLocalVariables(), GetInit(), FSM_NI_SSA_liveness::InternalExec(), NI_SSA_liveness::InternalExec(), port_swapping::InternalExec(), std_var_pp_functor::operator()(), pointer_var_pp_functor::operator()(), address_var_pp_functor::operator()(), isolated_var_pp_functor::operator()(), print_attributes(), PrintConstant(), PrintInit(), CdfgEdgeInfo::PrintLabels(), PrintNode(), PrintVariablesList(), MemoryInitializationCWriter::Process(), MemoryInitializationWriter::Process(), CheckSystemType::recursive_examinate(), HLSCWriter::WriteParamDecl(), HLSCWriter::WriteParamInitialization(), DiscrepancyAnalysisCWriter::writePostInstructionInfo(), EdgeCWriter::writeRoutineInstructions_rec(), CWriter::writeRoutineInstructions_rec(), and HLSCWriter::WriteTestbenchFunctionCall().
|
static |
rename a variable
var | is the index of the variable renamed |
new_name | is the new variable name |
Definition at line 6226 of file behavioral_helper.cpp.
References vars_renaming_table.
Referenced by EdgeCWriter::writeRoutineInstructions_rec(), and CWriter::writeRoutineInstructions_rec().
void BehavioralHelper::set_not_opaque | ( | ) |
void BehavioralHelper::set_opaque | ( | ) |
|
virtual |
Return the nodeID of the first statement of a basic block in case that statement is a label expression.
block | is basic block reference. |
Definition at line 6038 of file behavioral_helper.cpp.
References GET_CONST_NODE, GET_INDEX_NODE, and GET_NODE.
Referenced by EdgeCWriter::writeRoutineInstructions(), EdgeCWriter::writeRoutineInstructions_rec(), and CWriter::writeRoutineInstructions_rec().
|
protected |
The application manager.
Definition at line 81 of file behavioral_helper.hpp.
Referenced by IsLoad(), IsStore(), PrintNode(), and PrintVariable().
|
protected |
Flag to check if behavioral_graph_manager contains the function implementation.
Definition at line 111 of file behavioral_helper.hpp.
Referenced by has_implementation().
|
protected |
the debug level
Definition at line 90 of file behavioral_helper.hpp.
Referenced by CanBeSpeculated(), get_parameters(), GetInit(), GetParameters(), print_type_declaration(), PrintConstant(), and PrintNode().
|
staticprotected |
Maps between unqualified type and definition of a corresponding qualified type.
Definition at line 93 of file behavioral_helper.hpp.
|
protected |
Index of the function.
Definition at line 105 of file behavioral_helper.hpp.
Referenced by get_function_index(), get_parameters(), GetMangledFunctionName(), GetParameters(), GetParameterTypes(), is_var_args(), IsDefaultSsaName(), IsLoad(), and IsStore().
|
protected |
Name of the function.
Definition at line 108 of file behavioral_helper.hpp.
Referenced by function_has_to_be_printed(), and get_function_name().
|
protected |
Structure which stores initializations.
Definition at line 117 of file behavioral_helper.hpp.
Referenced by add_initialization(), and GetInit().
|
protected |
Flag to check if a call to this function has to be treated as a TYPE_OPAQUE nodeID.
Definition at line 114 of file behavioral_helper.hpp.
Referenced by get_opaque(), set_not_opaque(), and set_opaque().
|
protected |
The set of input parameters.
Definition at line 87 of file behavioral_helper.hpp.
Referenced by print_type_declaration(), PrintNode(), and PrintVariable().
|
protected |
The tree manager.
Definition at line 84 of file behavioral_helper.hpp.
Referenced by CanBeMoved(), CanBeSpeculated(), function_has_to_be_printed(), get_array_ref_array(), get_array_ref_index(), get_asm_string(), get_attributes(), get_component_ref_field(), get_component_ref_record(), get_definition(), get_indirect_ref_var(), get_intermediate_var(), get_label_name(), get_mem_ref_base(), get_mem_ref_offset(), get_operand_from_unary_expr(), get_parameters(), get_pointed_type(), get_size(), get_type(), GetElements(), GetFunctionReturnType(), GetInit(), GetMangledFunctionName(), GetParameters(), GetParameterTypes(), GetUnqualified(), GetVarFromSsa(), has_bit_field(), is_a_complex(), is_a_component_ref(), is_a_constant(), is_a_imagpart_expr(), is_a_mem_ref(), is_a_pointer(), is_a_realpart_expr(), is_a_result_decl(), is_a_struct(), is_a_vector(), is_an_addr_expr(), is_an_array(), is_an_array_ref(), is_an_enum(), is_an_indirect_ref(), is_an_union(), is_bool(), is_empty_return(), is_extern(), is_int(), is_named_pointer(), is_natural(), is_operating_system_function(), is_real(), is_static(), is_unsigned(), is_va_start_call(), is_var_args(), IsDefaultSsaName(), IsLoad(), IsLut(), IsStore(), print_attributes(), print_forward_declaration(), print_phinode_res(), print_type(), print_type_declaration(), PrintConstant(), PrintInit(), PrintNode(), PrintVarDeclaration(), and PrintVariable().
|
staticprotected |
Set of variables name already used.
Definition at line 96 of file behavioral_helper.hpp.
|
staticprotected |
Variable renaming table.
Definition at line 102 of file behavioral_helper.hpp.
Referenced by clear_renaming_table(), PrintVariable(), and rename_a_variable().
|
staticprotected |
The var symbol table.
Definition at line 99 of file behavioral_helper.hpp.
Referenced by InvaildateVariableName(), and PrintVariable().