00001 #ifndef MISC_H_INCLUDED_
00002 #define MISC_H_INCLUDED_
00003 
00004 #include "rose.h"
00005 #include <string>
00006 
00007 namespace risc
00008 {
00009 
00010 namespace tools
00011 {
00012 
00019 bool
00020 is_data_structure(SgType* type);
00021 
00028 bool
00029 is_builtin_type(SgType* type);
00030 
00031 
00038 bool
00039 class_types_are_identical(SgClassDefinition* cd1, SgClassDefinition* cd2);
00040 
00047 bool
00048 is_func_name(const SgFunctionDeclaration* function, const std::string& name);
00049 
00055 void
00056 print_indented(std::string s, unsigned indent);
00057 
00064 SgClassDefinition*
00065 class_definition_of_variable(SgVariableDeclaration* var_decl);
00066 
00074 bool
00075 is_builtin_function(SgFunctionDeclaration *func_decl);
00076 
00099 bool
00100 all_cfg_branches_end_in_break(SgNode *node, int &break_counter);
00101 
00124 bool
00125 all_cfg_branches_end_in_continue(SgNode *node, int &continue_counter);
00126 
00134 SgStatement*
00135 get_previous_stmt_in_basic_block(SgNode *node);
00136 
00144 bool
00145 is_conditional_break(SgScopeStatement const * const loop_stmt,
00146     SgBreakStmt const * const break_stmt);
00147 
00154 SgScopeStatement*
00155 find_break_surrounding_scope(SgBreakStmt *break_stmt);
00156 
00165 bool
00166 break_belongs_to_loop(SgScopeStatement *loop_stmt,
00167     SgBreakStmt const * const break_stmt);
00168 
00169 bool is_located_in_rose_header(SgNode *node);
00170 
00178 SgMemberFunctionDeclaration*
00179 get_constructor(SgClassDefinition *class_def);
00180 
00186 void
00187 find_and_replace_all(
00188     std::string &input,
00189     const std::string &from,
00190     const std::string &to);
00191 
00197 std::string get_mangled_name(SgClassDefinition *class_def);
00198 
00204 SgVariableSymbol* find_global_variable(std::string name, SgProject *project);
00205 
00211 bool is_in_std_namespace(SgDeclarationStatement *statement);
00212 
00218 bool is_in_systemc_namespace(SgDeclarationStatement *statement);
00219 
00225 bool is_in_gnu_cxx_namespace(SgDeclarationStatement *statement);
00226 
00235 SgVariableSymbol* get_most_outer_var(SgExpression *expr);
00236 
00241 bool has_no_variable_expressions(SgExpression *expr);
00242 
00243 }; 
00244 
00245 }; 
00246 
00247 #endif 
00248 
00249