PandA-2024.02
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes
BehavioralHelper Class Reference

#include <behavioral_helper.hpp>

Collaboration diagram for BehavioralHelper:
Collaboration graph
[legend]

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_nodeRefGetParameters () 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...
 

Detailed Description

Definition at line 77 of file behavioral_helper.hpp.

Constructor & Destructor Documentation

◆ BehavioralHelper()

BehavioralHelper::BehavioralHelper ( const application_managerRef  AppM,
unsigned int  index,
bool  body,
const ParameterConstRef  parameters 
)

Constructor.

Parameters
AppMis the application manager
indexis the index of the function_decl
bodyspecifies if function body is available
parametersis the set of input parameters

Definition at line 88 of file behavioral_helper.cpp.

References ~BehavioralHelper().

Here is the call graph for this function:

◆ ~BehavioralHelper()

BehavioralHelper::~BehavioralHelper ( )
virtualdefault

Destructor.

Referenced by BehavioralHelper().

Here is the caller graph for this function:

Member Function Documentation

◆ add_initialization()

void BehavioralHelper::add_initialization ( unsigned int  var,
unsigned int  init 
)

Add the initialization of a variables.

Parameters
varis the variable
initis the index of the initialization

Definition at line 1132 of file behavioral_helper.cpp.

References init(), and initializations.

Here is the call graph for this function:

◆ add_read_global_variable()

void BehavioralHelper::add_read_global_variable ( unsigned int  variable)

Add a read of a global variable.

Parameters
variableis the global variable read

◆ add_written_global_variable()

void BehavioralHelper::add_written_global_variable ( unsigned int  variable)

Add a writing of a global variables.

Parameters
variableis the global variable written

◆ CanBeMoved()

bool BehavioralHelper::CanBeMoved ( const unsigned int  node_index) const

Return if an operation can be moved.

Parameters
node_indexis 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.

Here is the call graph for this function:

◆ CanBeSpeculated()

bool BehavioralHelper::CanBeSpeculated ( const unsigned int  node_index) const

Return true if an operation can be speculated.

Parameters
node_indexis 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().

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

◆ clear_renaming_table()

void BehavioralHelper::clear_renaming_table ( )
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().

Here is the caller graph for this function:

◆ end_with_a_cond_or_goto()

unsigned int BehavioralHelper::end_with_a_cond_or_goto ( const blocRef &  block) const
virtual

Return the nodeID of the last statement of a basic block in case that statement is a cond or a goto expression.

Parameters
blockis 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().

Here is the caller graph for this function:

◆ function_has_to_be_printed()

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().

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

◆ get_array_ref_array()

unsigned int BehavioralHelper::get_array_ref_array ( unsigned int  obj) const
virtual

Return the array variable of an array ref.

Parameters
indexis 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()().

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

◆ get_array_ref_index()

unsigned int BehavioralHelper::get_array_ref_index ( unsigned int  obj) const
virtual

Return the index variable of an array ref.

Parameters
indexis 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()().

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

◆ get_asm_string()

std::string BehavioralHelper::get_asm_string ( const unsigned int  node_index) const

return the string associated with the gimple_asm

Parameters
node_indexis the gimple_asm node id
Returns
the string associated with gimple_asm

Definition at line 6289 of file behavioral_helper.cpp.

References tree_helper::get_asm_string(), and TM.

Here is the call graph for this function:

◆ get_attributes()

unsigned int BehavioralHelper::get_attributes ( unsigned int  var) const
virtual

return the attributes associated with the variable.

Parameters
varis the index of variable
Returns
the attribute associated to the 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().

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

◆ get_component_ref_field()

unsigned int BehavioralHelper::get_component_ref_field ( unsigned int  obj) const
virtual

Return the field index of a component ref.

Parameters
indexis 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()().

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

◆ get_component_ref_record()

unsigned int BehavioralHelper::get_component_ref_record ( unsigned int  obj) const
virtual

Return the record variable of a component ref.

Parameters
indexis 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()().

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

◆ get_definition()

std::tuple< std::string, unsigned int, unsigned int > BehavioralHelper::get_definition ( unsigned int  index,
bool is_system 
) const
virtual

Returns where the type index is defined.

Parameters
indexis the index typedef
booltells if the type hype has been already recognized as system
Returns
a pair composed by the filename and the line:column of the definitionFIXME: to be remove after substitution with tree_helper::GetSourcePath

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().

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

◆ get_function_index()

unsigned int BehavioralHelper::get_function_index ( ) const

◆ get_function_name()

std::string BehavioralHelper::get_function_name ( ) const

◆ get_indirect_ref_var()

unsigned int BehavioralHelper::get_indirect_ref_var ( unsigned int  obj) const
virtual

Return the variable of an indirect ref.

Parameters
indexis 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()().

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

◆ get_intermediate_var()

unsigned int BehavioralHelper::get_intermediate_var ( unsigned int  obj) const
virtual

Return the intermediate variable of an operation.

It returns 0 when there is not an intermediate variable.

Parameters
indexis 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().

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

◆ get_label_name()

const std::string BehavioralHelper::get_label_name ( unsigned int  label_expr_nid) const
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().

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

◆ get_mem_ref_base()

unsigned int BehavioralHelper::get_mem_ref_base ( unsigned int  obj) const
virtual

Return the base of a mem ref.

Parameters
indexis 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()().

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

◆ get_mem_ref_offset()

unsigned int BehavioralHelper::get_mem_ref_offset ( unsigned int  obj) const
virtual

Return the offset of a mem ref.

Parameters
indexis 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()().

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

◆ get_opaque()

bool BehavioralHelper::get_opaque ( ) const

Return the opaque flag.

Returns
the opaque flag

Definition at line 1147 of file behavioral_helper.cpp.

References opaque.

◆ get_operand_from_unary_expr()

unsigned int BehavioralHelper::get_operand_from_unary_expr ( unsigned int  obj) const
virtual

Return the index of the operand if index is addr_expr, a realpart_expr or a imagpart_expr.

Parameters
indexis the index of the expression
Returns
the index of the operand

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()().

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

◆ get_parameters()

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().

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

◆ get_pointed_type()

unsigned int BehavioralHelper::get_pointed_type ( const unsigned int  type) const
virtual

Return the pointed type of a pointer.

Parameters
typeis a pointer object

Definition at line 1157 of file behavioral_helper.cpp.

References tree_helper::CGetPointedType(), tree_manager::CGetTreeReindex(), index, and TM.

Here is the call graph for this function:

◆ get_read_global_variables()

CustomOrderedSet<unsigned int> BehavioralHelper::get_read_global_variables ( ) const

Get the global variables read by the correspondent function.

◆ get_size()

unsigned long long BehavioralHelper::get_size ( unsigned int  var) const
virtual

Return the size in bit of a C object.

Parameters
indexis the index of a C object
Returns
the size in bit

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().

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

◆ get_type()

unsigned int BehavioralHelper::get_type ( const unsigned int  var) const
virtual

Return the type of the variable.

Parameters
varis 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().

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

◆ get_written_global_variables()

CustomOrderedSet<unsigned int> BehavioralHelper::get_written_global_variables ( ) const

Get the global variables written by the correspondent function.

◆ GetElements()

unsigned int BehavioralHelper::GetElements ( const unsigned int  type) const

Given an array or a vector return the element type.

Parameters
indexis the type of the array
Returns
the type of the element

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().

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

◆ GetFunctionReturnType()

unsigned int BehavioralHelper::GetFunctionReturnType ( unsigned int  function) const

Return the index associated with the type of the return of the function.

Parameters
function_isis the index of the function
Returns
the index of the typeFIXME: to be remove after substitution with tree_helper::GetFunctionReturnType

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().

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

◆ GetInit()

unsigned int BehavioralHelper::GetInit ( unsigned int  var,
CustomUnorderedSet< unsigned int > &  list_of_variables 
) const
virtual

return the initialization object associated with the variable.

Parameters
varis the index of variable
list_of_variablesis used to return list of variables used during initialization
Returns
the index of the initialization object associated with the variable reference storing at the end true only if the variable has an initialization objetct. In case the variable does not have an initialization object this function returns 0.

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().

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

◆ GetMangledFunctionName()

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().

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

◆ GetParameters()

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().

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

◆ GetParameterTypes()

TreeNodeConstSet BehavioralHelper::GetParameterTypes ( ) const
virtual

Returns the types of the parameters.

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.

Here is the call graph for this function:

◆ GetTypecast()

void BehavioralHelper::GetTypecast ( const tree_nodeConstRef tn,
TreeNodeConstSet types 
) const
virtual

return the types used in type casting by tn

Parameters
tnis the statement analyzed
typesis the set of types type-casted by tn

Definition at line 6236 of file behavioral_helper.cpp.

References tree_node::visit().

Here is the call graph for this function:

◆ GetUnqualified()

unsigned int BehavioralHelper::GetUnqualified ( const unsigned int  index) const

Return the unqualified version of a type.

Parameters
typeis the type
Returns
the unqualified version of the type if it exists, 0 otherwise

Definition at line 6213 of file behavioral_helper.cpp.

References tree_helper::GetUnqualified(), and TM.

Referenced by structural_type_descriptor::structural_type_descriptor().

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

◆ GetVarFromSsa()

unsigned int BehavioralHelper::GetVarFromSsa ( unsigned int  index) const
virtual

Return the index of the variable base of a ssa var.

Parameters
indexis the index of the ssa var
Returns
the index of the base variable

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()().

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

◆ has_bit_field()

bool BehavioralHelper::has_bit_field ( unsigned int  variable) const
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().

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

◆ has_implementation()

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().

Here is the caller graph for this function:

◆ InvaildateVariableName()

void BehavioralHelper::InvaildateVariableName ( const unsigned int  index)

Invalidate cached variable name.

Parameters
indexis the variable whose name must be invalidated

Definition at line 6577 of file behavioral_helper.cpp.

References vars_symbol_table.

◆ is_a_complex()

bool BehavioralHelper::is_a_complex ( unsigned int  index) const
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().

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

◆ is_a_component_ref()

bool BehavioralHelper::is_a_component_ref ( unsigned int  variable) const
virtual

Return true if the index is a component ref.

Parameters
indexis 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()().

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

◆ is_a_constant()

bool BehavioralHelper::is_a_constant ( unsigned int  obj) const
virtual

Return true if the index is a constant object.

Parameters
indexis a nodeID.
Returns
true if it's a constant object

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().

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

◆ is_a_imagpart_expr()

bool BehavioralHelper::is_a_imagpart_expr ( unsigned int  obj) const
virtual

Return true if index is a imagpart_expr.

Parameters
indexis the index of the node
Returns
true if index is a imagpart_expr

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()().

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

◆ is_a_mem_ref()

bool BehavioralHelper::is_a_mem_ref ( unsigned int  variable) const
virtual

Return true if the index is a mem_ref.

Parameters
indexis 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()().

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

◆ is_a_pointer()

bool BehavioralHelper::is_a_pointer ( unsigned int  variable) const
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().

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

◆ is_a_realpart_expr()

bool BehavioralHelper::is_a_realpart_expr ( unsigned int  obj) const
virtual

Return true if index is a realpart_expr.

Parameters
indexis the index of the node
Returns
true if index is a realpart_expr

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()().

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

◆ is_a_result_decl()

bool BehavioralHelper::is_a_result_decl ( unsigned int  obj) const
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.

Here is the call graph for this function:

◆ is_a_struct()

bool BehavioralHelper::is_a_struct ( unsigned int  variable) const
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().

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

◆ is_a_vector()

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().

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

◆ is_an_addr_expr()

bool BehavioralHelper::is_an_addr_expr ( unsigned int  variable) const
virtual

Return true if the index is an addr_expr.

Parameters
indexis 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()().

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

◆ is_an_array()

bool BehavioralHelper::is_an_array ( unsigned int  variable) const
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().

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

◆ is_an_array_ref()

bool BehavioralHelper::is_an_array_ref ( unsigned int  variable) const
virtual

Return true if the index is an array ref.

Parameters
indexis 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()().

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

◆ is_an_enum()

bool BehavioralHelper::is_an_enum ( unsigned int  index) const
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.

Here is the call graph for this function:

◆ is_an_indirect_ref()

bool BehavioralHelper::is_an_indirect_ref ( unsigned int  variable) const
virtual

Return true if the index is an indirect ref.

Parameters
indexis 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()().

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

◆ is_an_union()

bool BehavioralHelper::is_an_union ( unsigned int  variable) const
virtual

Return true if index is a variable of a type of type union.

Parameters
indexis the index of the variable or of the type
Returns
true if variable or type is of type union

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().

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

◆ is_bool()

bool BehavioralHelper::is_bool ( unsigned int  index) const
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().

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

◆ is_empty_return()

bool BehavioralHelper::is_empty_return ( unsigned int  index) const
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.

Here is the call graph for this function:

◆ is_extern()

bool BehavioralHelper::is_extern ( unsigned int  decl) const
virtual

check if a given index is a extern declaration

Parameters
declis the decl index id
Returns
true whem decl is an extern function or variable declaration

Definition at line 5303 of file behavioral_helper.cpp.

References tree_helper::is_extern(), and TM.

Here is the call graph for this function:

◆ is_int()

bool BehavioralHelper::is_int ( unsigned int  index) const
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().

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

◆ is_name_used()

unsigned int BehavioralHelper::is_name_used ( std::string  var) const

Return if a variable with this name already exists.

Parameters
varis the name of the variable
Returns
0 if is name hasn't been used, index of the existing variable with that name otherwise

◆ is_named_pointer()

unsigned int BehavioralHelper::is_named_pointer ( const unsigned int  index) const
virtual

return the nodeid of the named pointer (pointer_type with a name different

Parameters
indexis 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.

Here is the call graph for this function:

◆ is_natural()

bool BehavioralHelper::is_natural ( unsigned int  index) const
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.

Here is the call graph for this function:

◆ is_operating_system_function()

bool BehavioralHelper::is_operating_system_function ( const unsigned int  obj) const
virtual

Return true if function is an operating system function.

Parameters
indexis the index of the node
Returns
true if index is a library system function

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().

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

◆ is_real()

bool BehavioralHelper::is_real ( unsigned int  index) const
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().

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

◆ is_static()

bool BehavioralHelper::is_static ( unsigned int  decl) const
virtual

check if a given index is a static declaration

Parameters
declis the decl index id
Returns
true whem decl is a static function or variable declaration

Definition at line 5298 of file behavioral_helper.cpp.

References tree_helper::is_static(), and TM.

Here is the call graph for this function:

◆ is_unsigned()

bool BehavioralHelper::is_unsigned ( unsigned int  index) const
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().

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

◆ is_va_start_call()

bool BehavioralHelper::is_va_start_call ( unsigned int  stm) const
virtual

return true in case stm is a va_start call_expr

Parameters
stmis 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.

Here is the call graph for this function:

◆ is_var_args()

bool BehavioralHelper::is_var_args ( ) const
virtual

Returns true if this function is of var args type.

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().

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

◆ IsDefaultSsaName()

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()().

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

◆ IsLoad()

bool BehavioralHelper::IsLoad ( const unsigned int  statement_index) const

Return if an operation is a load.

Parameters
statement_indexis the index of the tree node
Returns
true if statement is a load

Definition at line 6566 of file behavioral_helper.cpp.

References AppM, tree_manager::CGetTreeReindex(), function_index, tree_helper::IsLoad(), and TM.

Referenced by CanBeSpeculated().

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

◆ IsLut()

bool BehavioralHelper::IsLut ( const unsigned int  statement_index) const

Return if an operation is a lut_expr.

Parameters
statement_indexis the index of the tree node
Returns
true if statement is a lut_expr

Definition at line 6572 of file behavioral_helper.cpp.

References tree_manager::CGetTreeReindex(), tree_helper::IsLut(), and TM.

Here is the call graph for this function:

◆ IsStore()

bool BehavioralHelper::IsStore ( const unsigned int  statement_index) const

Return if an operation is a store.

Parameters
statement_indexis the index of the tree node
Returns
true if statement is a store

Definition at line 6560 of file behavioral_helper.cpp.

References AppM, tree_manager::CGetTreeReindex(), function_index, tree_helper::IsStore(), and TM.

Referenced by CanBeSpeculated().

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

◆ print_attributes()

std::string BehavioralHelper::print_attributes ( unsigned int  var,
const var_pp_functorConstRef  vppf,
bool  first = true 
) const
virtual

Print the attributes associated to a variable.

Parameters
indexis the attribute node
vppfis 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().

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

◆ print_forward_declaration()

std::string BehavioralHelper::print_forward_declaration ( unsigned int  type) const
virtual

Print the declaration of a non built-in type.

Parameters
typeis 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().

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

◆ print_phinode_res()

std::string BehavioralHelper::print_phinode_res ( unsigned int  phi_node_id,
vertex  v,
const var_pp_functorConstRef  vppf 
) const
virtual

Definition at line 6029 of file behavioral_helper.cpp.

References tree_manager::CGetTreeNode(), phi, PrintNode(), THROW_ASSERT, and TM.

Here is the call graph for this function:

◆ print_type()

std::string BehavioralHelper::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
virtual

Print a type and its variable in case var is not zero.

Parameters
typeis the type of var.
globaltells if the variable is global
print_qualifierstells if the qualifiers (i.e. "const") have to be printed
print_storagetells if the storage (i.e. "static") has to be printed
varis the variable.
vppfis the pointer to the functor used to dump the possible variable var
prefixis the string to be appended at the begining of the printing
Returns
the printed string

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().

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

◆ print_type_declaration()

std::string BehavioralHelper::print_type_declaration ( unsigned int  type) const
virtual

Print the declaration of a non built-in type.

Parameters
typeis 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().

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

◆ print_vertex()

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.

Parameters
gis the graph
vis the vertex
vppfis the functor used to dump the variable var.
dottells 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().

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

◆ PrintConstant()

std::string BehavioralHelper::PrintConstant ( const tree_nodeConstRef var,
const var_pp_functorConstRef  vppf = var_pp_functorConstRef() 
) const
virtual

◆ PrintInit()

std::string BehavioralHelper::PrintInit ( const tree_nodeConstRef var,
const var_pp_functorConstRef  vppf 
) const
virtual

Print the initialization part.

Parameters
varis the initialization expression.
vppfis 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().

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

◆ PrintNode() [1/2]

std::string BehavioralHelper::PrintNode ( const tree_nodeConstRef node,
vertex  v,
const var_pp_functorConstRef  vppf 
) const
virtual

Print the operations corresponding to the node.

Parameters
nodeis the node to print
vis the vertex of the operation
vppfis the functor used to dump the variable var. The stream on which string is printed is the one associate with the identer
Returns
the string corrisponding to the node

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().

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

◆ PrintNode() [2/2]

std::string BehavioralHelper::PrintNode ( unsigned int  node_id,
vertex  v,
const var_pp_functorConstRef  vppf 
) const
virtual

Definition at line 1220 of file behavioral_helper.cpp.

References tree_manager::CGetTreeNode(), PrintNode(), and TM.

Here is the call graph for this function:

◆ PrintVarDeclaration()

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.

Parameters
varis the considered variable.
vppfis the functor used to dump the variable var.
init_has_to_be_printedtells 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().

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

◆ PrintVariable()

std::string BehavioralHelper::PrintVariable ( unsigned int  var) const

Print the name of the variable associated to the index.

Parameters
indexis the considered variable.
Returns
the name of the 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().

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

◆ rename_a_variable()

void BehavioralHelper::rename_a_variable ( unsigned int  var,
const std::string &  new_name 
)
static

rename a variable

Parameters
varis the index of the variable renamed
new_nameis 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().

Here is the caller graph for this function:

◆ set_not_opaque()

void BehavioralHelper::set_not_opaque ( )

Set opaque flag to false.

Definition at line 1142 of file behavioral_helper.cpp.

References opaque.

◆ set_opaque()

void BehavioralHelper::set_opaque ( )

Set opaque flag to true.

Definition at line 1137 of file behavioral_helper.cpp.

References opaque.

◆ start_with_a_label()

unsigned int BehavioralHelper::start_with_a_label ( const blocRef &  block) const
virtual

Return the nodeID of the first statement of a basic block in case that statement is a label expression.

Parameters
blockis 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().

Here is the caller graph for this function:

Field Documentation

◆ AppM

const application_managerRef BehavioralHelper::AppM
protected

The application manager.

Definition at line 81 of file behavioral_helper.hpp.

Referenced by IsLoad(), IsStore(), PrintNode(), and PrintVariable().

◆ body

bool BehavioralHelper::body
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().

◆ debug_level

int BehavioralHelper::debug_level
protected

◆ definitions

std::map<unsigned int, std::pair<std::string, int> > BehavioralHelper::definitions
staticprotected

Maps between unqualified type and definition of a corresponding qualified type.

Definition at line 93 of file behavioral_helper.hpp.

◆ function_index

unsigned int BehavioralHelper::function_index
protected

◆ function_name

std::string BehavioralHelper::function_name
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().

◆ initializations

std::map<unsigned int, unsigned int> BehavioralHelper::initializations
protected

Structure which stores initializations.

Definition at line 117 of file behavioral_helper.hpp.

Referenced by add_initialization(), and GetInit().

◆ opaque

bool BehavioralHelper::opaque
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().

◆ Param

const ParameterConstRef BehavioralHelper::Param
protected

The set of input parameters.

Definition at line 87 of file behavioral_helper.hpp.

Referenced by print_type_declaration(), PrintNode(), and PrintVariable().

◆ TM

const tree_managerConstRef BehavioralHelper::TM
protected

◆ used_name

std::map< std::string, unsigned int > BehavioralHelper::used_name
staticprotected

Set of variables name already used.

Definition at line 96 of file behavioral_helper.hpp.

◆ vars_renaming_table

std::map< unsigned int, std::string > BehavioralHelper::vars_renaming_table
staticprotected

Variable renaming table.

Definition at line 102 of file behavioral_helper.hpp.

Referenced by clear_renaming_table(), PrintVariable(), and rename_a_variable().

◆ vars_symbol_table

std::map< unsigned int, std::string > BehavioralHelper::vars_symbol_table
staticprotected

The var symbol table.

Definition at line 99 of file behavioral_helper.hpp.

Referenced by InvaildateVariableName(), and PrintVariable().


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

Generated on Mon Feb 12 2024 13:03:45 for PandA-2024.02 by doxygen 1.8.13