risc::tools Namespace Reference

Classes

class  AstAttributeColor
struct  UserSpaceFilter
class  SystemCDefinitionFinder
 This class stores all SystemC definition pointer. More...

Functions

bool is_derived_from (SgClassDefinition *derived_class, SgClassDefinition *base_class)
 This function checks if the derived class is derived from the base class.
bool is_derived_from_sc_interface (SgClassDefinition *derived_class)
 This function checks if the class is derived from sc_interface.
bool is_derived_from_sc_channel (SgClassDefinition *derived_class)
 This function checks if the class is derived from sc_channel.
bool is_derived_from_sc_prim_channel (SgClassDefinition *derived_class)
 This function checks if the class is derived from sc_prim_channel.
bool is_derived_from_sc_module (SgClassDefinition *derived_class)
 This function checks if the class is derived from sc_module.
bool is_derived_from_sc_port (SgClassDefinition *derived_class)
 This function checks if the class is derived from sc_port.
bool is_derived_from_sc_port_base (SgClassDefinition *derived_class)
 This function checks if the class is derived from sc_port_base.
bool is_derived_from_sc_port_base (SgVarRefExp *var_ref)
 This function checks if the class is derived from sc_port_base.
bool is_sc_event (SgClassDefinition *derived_class)
 This function checks if the class is derived from sc_event or if it is sc_event itself.
bool is_sc_event (SgVarRefExp *var_ref)
 This function checks if the class is derived from sc_event or if it is sc_event itself.
bool is_sc_in_port (SgTemplateInstantiationDefn *template_class)
 This function checks if the template class bases on the class template sc_in_port.
bool is_sc_out_port (SgTemplateInstantiationDefn *template_class)
 This function checks if the template class bases on the class template sc_out_port.
bool is_sc_inout_port (SgTemplateInstantiationDefn *template_class)
 This function checks if the template class bases on the class template sc_inout_port.
bool is_sc_in_clk (SgClassDefinition *definition)
 This function checks if the given defintion is qual to the definition of a sc_in_clk.
bool is_sc_out_clk (SgClassDefinition *definition)
 This function checks if the given defintion is qual to the definition of a sc_out_clk.
bool is_sc_inout_clk (SgClassDefinition *definition)
 This function checks if the given defintion is qual to the definition of a sc_inout_clk.
bool is_sc_in_bool (SgClassDefinition *definition)
 This function checks if the given defintion is qual to the definition of a sc_in<bool>.
std::vector< std::string > preparsing_commandline_arguments (int &argc, char **&argv, std::vector< std::string > &input_files)
 This function takes the parameter of the command line and creates a source file which includes all the source files. Afterwards all source files are replaced with new file in the command parameters. Example.
StringUtility::FileNameLibrary get_library (int file_id)
StringUtility::FileNameLibrary get_library (Sg_File_Info *X)
bool is_data_structure (SgType *type)
 This function checks if the passed type represents a data structure.
bool is_builtin_type (SgType *type)
 This function checks if the passed type represents a C++ builtin type.
bool class_types_are_identical (SgClassDefinition *cd1, SgClassDefinition *cd2)
 Compares two classes.
bool is_func_name (const SgFunctionDeclaration *function, const std::string &name)
 Compares the function name with the given string.
void print_indented (std::string s, unsigned indent)
 Prints a string with indention.
SgClassDefinition * class_definition_of_variable (SgVariableDeclaration *var_decl)
 Determines the class defintion of varialbe It is expected that the type is SgClassType.
bool is_builtin_function (SgFunctionDeclaration *func_decl)
 Checks if a given function is a C++ builtin function This function is taken/inspired from the Rose builtinFilter structure.
bool all_cfg_branches_end_in_break (SgNode *node, int &break_counter)
 This function determines if all cfg branches in the statement 'node' will end in a break statement. The statement in end will be excluded. Some examples:.
bool all_cfg_branches_end_in_continue (SgNode *node, int &continue_counter)
 This function determines if all cfg branches in the statement 'node' will end in a continue statement. The statement in end will be excluded. Some examples:.
SgStatement * get_previous_stmt_in_basic_block (SgNode *node)
 This function determines the previous statement of the statement 'node' in the next surrounding basic block. If 'node' is the first statement, the return value will be NULL.
bool is_conditional_break (SgScopeStatement const *const loop_stmt, SgBreakStmt const *const break_stmt)
 This function checks if a given break statement is unconditioned.
SgScopeStatement * find_break_surrounding_scope (SgBreakStmt *break_stmt)
 This function finds the surrounding scope statement of a break. The break can be surrounded by a while, do while, for loop or by a switch statement.
bool break_belongs_to_loop (SgScopeStatement *loop_stmt, SgBreakStmt const *const break_stmt)
 This function checks if a given break statement belongs to a given loop statements.
bool is_located_in_rose_header (SgNode *node)
SgMemberFunctionDeclaration * get_constructor (SgClassDefinition *class_def)
 This function returns the constructor of class. For a module, primitive channel, and a hierarchical channel we expect exactly one constructor. So, we return the first SgFunctionDefinition which es a constructor.
SgClassDefinition * find_class_definition (std::string class_name, std::string qualified_namespace, SgNode *root_node)
 This function searchs for a class by name (string) in namespace (string).
SgTypedefDeclaration * find_typedef_declaration (std::string class_name, std::string qualified_namespace, SgNode *root_node)
 This function searchs for a typedef's by name (string) in namespace (string).
bool is_reference_variable (SgVariableSymbol *var_symbol)
 This function return true if the given variable symbol is a reference.
bool is_global_variable (SgVariableSymbol *var_symbol)
 This function return true if the given variable symbol is a global variable.
bool is_local_variable (SgVariableSymbol *var_symbol)
 This function return true if the given variable symbol is a local variable.
bool is_member_variable (SgVariableSymbol *var_symbol)
 This function return true if the given variable symbol is a member variable.
bool is_static_variable (SgVariableSymbol *var_symbol)
 This function return true if the given variable symbol is a static variable.
bool is_namespace_variable (SgVariableSymbol *var_symbol)
 This function return true if the given variable symbol is a namespace variable.
bool is_function_parameter_variable (SgVariableSymbol *var_symbol)
 This function return true if the given variable symbol is a function variable.
bool is_member_of (SgVariableSymbol *is, SgSymbol *of)
 This function returns true if a given variable symbol is defined 'in' another variable symobl. For instance 'class Foo { int i;}' 'i' is defined in 'Foo'.

Function Documentation

bool risc::tools::all_cfg_branches_end_in_break ( SgNode *  node,
int &  break_counter 
)

This function determines if all cfg branches in the statement 'node' will end in a break statement. The statement in end will be excluded. Some examples:.

all_cfg_branches_end_in_break input with result: true break; <-- node int a;

input with result: false if(test) <-- node break; int a;

input with result: true if(test) <-- node break; else break; int a;

bool risc::tools::all_cfg_branches_end_in_continue ( SgNode *  node,
int &  continue_counter 
)

This function determines if all cfg branches in the statement 'node' will end in a continue statement. The statement in end will be excluded. Some examples:.

all_cfg_branches_end_in_break input with result: true continue; <-- node int a;

input with result: false if(test); <-- node continue; int a;

input with result: true if(test); <-- node continue; else continue; int a;

bool risc::tools::break_belongs_to_loop ( SgScopeStatement *  loop_stmt,
SgBreakStmt const *const   break_stmt 
)

This function checks if a given break statement belongs to a given loop statements.

break_belongs_to_loop

Parameters:
loop_stmt Pointer to the loop statement
break_stmt Pointer to the break statement
SgClassDefinition * risc::tools::class_definition_of_variable ( SgVariableDeclaration *  var_decl  ) 

Determines the class defintion of varialbe It is expected that the type is SgClassType.

Parameters:
var_decl The given variable declaration
Returns:
Associated SgClassDefintion of the var_decl
bool risc::tools::class_types_are_identical ( SgClassDefinition *  cd1,
SgClassDefinition *  cd2 
)

Compares two classes.

Parameters:
cd1 Class definition 1
cd2 Class definition 2
Returns:
True, if the types are equal
SgScopeStatement * risc::tools::find_break_surrounding_scope ( SgBreakStmt *  break_stmt  ) 

This function finds the surrounding scope statement of a break. The break can be surrounded by a while, do while, for loop or by a switch statement.

find_break_associated_loop

SgClassDefinition * risc::tools::find_class_definition ( std::string  class_name,
std::string  qualified_namespace,
SgNode *  root_node 
)

This function searchs for a class by name (string) in namespace (string).

Parameters:
class_name Name of the class
qualified_namespace The absolute qualified namespace
root_node In this subtree the search will performed
Returns:
Pointer to the class definition. The pointer is zero, if the class does not exist in the given namespace
SgTypedefDeclaration * risc::tools::find_typedef_declaration ( std::string  class_name,
std::string  qualified_namespace,
SgNode *  root_node 
)

This function searchs for a typedef's by name (string) in namespace (string).

Parameters:
class_name Name of the class
qualified_namespace The absolute qualified namespace
root_node In this subtree the search will performed
Returns:
Pointer to the class definition. The pointer is zero, if the class does not exist in the given namespace
SgMemberFunctionDeclaration * risc::tools::get_constructor ( SgClassDefinition *  class_def  ) 

This function returns the constructor of class. For a module, primitive channel, and a hierarchical channel we expect exactly one constructor. So, we return the first SgFunctionDefinition which es a constructor.

get_constructor

StringUtility::FileNameLibrary risc::tools::get_library ( Sg_File_Info *  X  ) 
StringUtility::FileNameLibrary risc::tools::get_library ( int  file_id  ) 
SgStatement * risc::tools::get_previous_stmt_in_basic_block ( SgNode *  node  ) 

This function determines the previous statement of the statement 'node' in the next surrounding basic block. If 'node' is the first statement, the return value will be NULL.

get_previous_stmt_in_basic_block

bool risc::tools::is_builtin_function ( SgFunctionDeclaration *  func_decl  ) 

Checks if a given function is a C++ builtin function This function is taken/inspired from the Rose builtinFilter structure.

Parameters:
func_decl Function declaration
Returns:
true, if builtin function
bool risc::tools::is_builtin_type ( SgType *  type  ) 

This function checks if the passed type represents a C++ builtin type.

Parameters:
type Type that will be checked
Returns:
True, if the type represents a C++ builtin type
bool risc::tools::is_conditional_break ( SgScopeStatement const *const   loop_stmt,
SgBreakStmt const *const   break_stmt 
)

This function checks if a given break statement is unconditioned.

is_conditional_break

Parameters:
loop_stmt Pointer to the loop statement
break_stmt Pointer to the break statement
bool risc::tools::is_data_structure ( SgType *  type  ) 

This function checks if the passed type represents a data structure.

Parameters:
type Type that will be checked
Returns:
True, if the type represents a data structure
bool risc::tools::is_derived_from ( SgClassDefinition *  derived_class,
SgClassDefinition *  base_class 
)

This function checks if the derived class is derived from the base class.

Parameters:
derived_class the derived class definition
base_class the base class definition
Returns:
true, if the class defintion derived_class is derived from calls definition base_class. Otherwise false
bool risc::tools::is_derived_from_sc_channel ( SgClassDefinition *  derived_class  ) 

This function checks if the class is derived from sc_channel.

Parameters:
derived_class the derived class definition
Returns:
True, if the class is derived from sc_module
Parameters:
derived_class the derived class definition
Returns:
True, if the class is derived from sc_channel
bool risc::tools::is_derived_from_sc_interface ( SgClassDefinition *  derived_class  ) 

This function checks if the class is derived from sc_interface.

Parameters:
derived_class the derived class definition
Returns:
True, if the class is derived from sc_interface
bool risc::tools::is_derived_from_sc_module ( SgClassDefinition *  derived_class  ) 

This function checks if the class is derived from sc_module.

Parameters:
derived_class the derived class definition
Returns:
True, if the class is derived from sc_module
bool risc::tools::is_derived_from_sc_port ( SgClassDefinition *  derived_class  ) 

This function checks if the class is derived from sc_port.

Parameters:
derived_class the derived class definition
Returns:
True, if the class is derived from sc_port
bool risc::tools::is_derived_from_sc_port_base ( SgVarRefExp *  var_ref  ) 

This function checks if the class is derived from sc_port_base.

Parameters:
derived_class the derived class definition
Returns:
True, if the class is derived from sc_port_base
bool risc::tools::is_derived_from_sc_port_base ( SgClassDefinition *  derived_class  ) 

This function checks if the class is derived from sc_port_base.

Parameters:
derived_class the derived class definition
Returns:
True, if the class is derived from sc_port_base
bool risc::tools::is_derived_from_sc_prim_channel ( SgClassDefinition *  derived_class  ) 

This function checks if the class is derived from sc_prim_channel.

Parameters:
derived_class the derived class definition
Returns:
True, if the class is derived from sc_module
Parameters:
derived_class the derived class definition
Returns:
True, if the class is derived from sc_prim_channel
bool risc::tools::is_func_name ( const SgFunctionDeclaration *  function,
const std::string &  name 
)

Compares the function name with the given string.

Parameters:
function The function declaration
name String which will be compared
Returns:
True, if the string and the function name are equal
bool risc::tools::is_function_parameter_variable ( SgVariableSymbol *  var_symbol  ) 

This function return true if the given variable symbol is a function variable.

is_member_variable

bool risc::tools::is_global_variable ( SgVariableSymbol *  var_symbol  ) 

This function return true if the given variable symbol is a global variable.

is_global_variable

bool risc::tools::is_local_variable ( SgVariableSymbol *  var_symbol  ) 

This function return true if the given variable symbol is a local variable.

is_local_variable

bool risc::tools::is_located_in_rose_header ( SgNode *  node  ) 
bool risc::tools::is_member_of ( SgVariableSymbol *  is,
SgSymbol *  of 
)

This function returns true if a given variable symbol is defined 'in' another variable symobl. For instance 'class Foo { int i;}' 'i' is defined in 'Foo'.

is_member_of

bool risc::tools::is_member_variable ( SgVariableSymbol *  var_symbol  ) 

This function return true if the given variable symbol is a member variable.

is_member_variable

bool risc::tools::is_namespace_variable ( SgVariableSymbol *  var_symbol  ) 

This function return true if the given variable symbol is a namespace variable.

is_namespace_variable

bool risc::tools::is_reference_variable ( SgVariableSymbol *  var_symbol  ) 

This function return true if the given variable symbol is a reference.

is_reference_variable

bool risc::tools::is_sc_event ( SgVarRefExp *  var_ref  ) 

This function checks if the class is derived from sc_event or if it is sc_event itself.

Parameters:
derived_class the derived class definition
Returns:
True, if the class is derived from sc_event
bool risc::tools::is_sc_event ( SgClassDefinition *  derived_class  ) 

This function checks if the class is derived from sc_event or if it is sc_event itself.

Parameters:
derived_class the derived class definition
Returns:
True, if the class is derived from sc_event
bool risc::tools::is_sc_in_bool ( SgClassDefinition *  definition  ) 

This function checks if the given defintion is qual to the definition of a sc_in<bool>.

Parameters:
class the class definition
Returns:
True, if equal
bool risc::tools::is_sc_in_clk ( SgClassDefinition *  definition  ) 

This function checks if the given defintion is qual to the definition of a sc_in_clk.

Parameters:
class the class definition
Returns:
True, if equal
bool risc::tools::is_sc_in_port ( SgTemplateInstantiationDefn *  template_class  ) 

This function checks if the template class bases on the class template sc_in_port.

Parameters:
class the class definition
Returns:
True, if the template class bases on the class template sc_in_port
bool risc::tools::is_sc_inout_clk ( SgClassDefinition *  definition  ) 

This function checks if the given defintion is qual to the definition of a sc_inout_clk.

Parameters:
class the class definition
Returns:
True, if equal
bool risc::tools::is_sc_inout_port ( SgTemplateInstantiationDefn *  template_class  ) 

This function checks if the template class bases on the class template sc_inout_port.

Parameters:
class the class definition
Returns:
True, if the template class bases on the class template sc_inout_port
bool risc::tools::is_sc_out_clk ( SgClassDefinition *  definition  ) 

This function checks if the given defintion is qual to the definition of a sc_out_clk.

Parameters:
class the class definition
Returns:
True, if equal
bool risc::tools::is_sc_out_port ( SgTemplateInstantiationDefn *  template_class  ) 

This function checks if the template class bases on the class template sc_out_port.

Parameters:
class the class definition
Returns:
True, if the template class bases on the class template sc_out_port
bool risc::tools::is_static_variable ( SgVariableSymbol *  var_symbol  ) 

This function return true if the given variable symbol is a static variable.

is_static_variable

std::vector< std::string > risc::tools::preparsing_commandline_arguments ( int &  argc,
char **&  argv,
std::vector< std::string > &  input_files 
)

This function takes the parameter of the command line and creates a source file which includes all the source files. Afterwards all source files are replaced with new file in the command parameters. Example.

Input: ./myprogram file_a.cpp file_b.cpp file_c.cpp

Output ./myprogram __main__.cpp

New file __main__.cpp include "file_a.cpp" include "file_b.cpp" include "file_c.cpp"

Returns:
vector of strings with the new parameters
void risc::tools::print_indented ( std::string  s,
unsigned  indent 
)

Prints a string with indention.

Parameters:
s Sting to print
indent Indention level
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 29 Oct 2015 by  doxygen 1.6.1