ROSE  0.9.6a
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
manglingSupport.h
Go to the documentation of this file.
1 #ifndef mangling_support_INCLUDED
2 #define mangling_support_INCLUDED
3 std::string replaceNonAlphaNum (const std::string& s);
4 
6 std::string trimSpaces (const std::string& s);
7 
8 #if 0
9 bool isValidMangledName (std::string name);
11 #endif
12 
14 std::string joinMangledQualifiersToString (const std::string& base, const std::string& name);
15 
17 SgName joinMangledQualifiers (const SgName& base, const SgName& name);
18 
21 
22 // *****************************************************************
23 // New code added to support better name mangling
24 // *****************************************************************
25 
34 size_t getLocalScopeNum (const SgFunctionDefinition* func_def, const SgScopeStatement* target);
35 // size_t getLocalScopeNum ( SgFunctionDefinition* func_def, const SgScopeStatement* target);
36 
38 std::string mangleLocalScopeToString (const SgScopeStatement* scope);
39 
45 std::string mangleQualifiersToString (const SgScopeStatement* scope);
46 
51 
59 std::string mangleTypesToString (const SgTypePtrList::const_iterator b, const SgTypePtrList::const_iterator e);
60 
64 SgName mangleTypes (const SgTypePtrList::const_iterator b, const SgTypePtrList::const_iterator e);
65 
82 std::string mangleFunctionNameToString (const std::string& s, const std::string& ret_type_name = std::string (""));
83 
87 SgName mangleFunctionName (const SgName& n, const SgName& ret_type_name = SgName (""));
88 
95 std::string mangleTemplateArgsToString (const SgTemplateArgumentPtrList::const_iterator b, const SgTemplateArgumentPtrList::const_iterator e);
96 
97 #if 0
98 // DQ (2/7/2006): This function is not used or required.
102 SgName mangleTemplateArgs (const SgTemplateArgumentPtrList::const_iterator b, const SgTemplateArgumentPtrList::const_iterator e);
103 #endif
104 
115 std::string mangleTemplateToString (const std::string& templ_name,
116  const SgTemplateArgumentPtrList& templ_args,
117  const SgScopeStatement* scope);
118 
120 SgName mangleTemplate (const SgName& templ_name,
121  const SgTemplateArgumentPtrList& templ_args,
122  const SgScopeStatement* scope);
123 
135 std::string
136 mangleTemplateFunctionToString (const std::string& templ_name,
137  const SgTemplateArgumentPtrList& templ_args,
138  const SgFunctionType* func_type,
139  const SgScopeStatement* scope);
140 
145 SgName
146 mangleTemplateFunction (const std::string& templ_name,
147  const SgTemplateArgumentPtrList& templ_args,
148  const SgFunctionType* func_type,
149  const SgScopeStatement* scope);
150 
152 std::string mangleSgValueExp (const SgBoolValExp* expr);
153 
155 std::string mangleValueExp (const SgValueExp* expr);
156 
161 std::string mangleExpression (const SgExpression* expr);
162 
167 
168 #if 0
169 // DQ (3/29/2006): I think this is only required interanlly in the mangledSupport.C file (where it is defined)
170 
177 template <class SgValueExpType_>
178 std::string
179 mangleSgValueExp (const SgValueExpType_* expr)
180  {
181  // Verify that SgValueExpType_ descends from SgValueExp.
182  ROSE_ASSERT (isSgValueExp (expr) || !expr);
183 
184  ostringstream mangled_name;
185  if (expr)
186  mangled_name << expr->get_value ();
187  return mangled_name.str ();
188  }
189 #endif
190 
191 #endif // mangling_support_INCLUDED