manglingSupport.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

std::string replaceNonAlphaNum (const std::string &s)
std::string trimSpaces (const std::string &s)
 Returns the input std::string stripped of leading and trailing spaces.
std::string joinMangledQualifiersToString (const std::string &base, const std::string &name)
 Joins two sets of mangled qualifiers to form a new mangled qualifier.
SgName joinMangledQualifiers (const SgName &base, const SgName &name)
 Joins two sets of mangled qualifiers to form a new mangled qualifier.
const SgFunctionDefinitionfindRootFunc (const SgScopeStatement *scope)
 Returns the function definition containing the specified statement.
size_t getLocalScopeNum (const SgFunctionDefinition *func_def, const SgScopeStatement *target)
std::string mangleLocalScopeToString (const SgScopeStatement *scope)
 Produces a mangled name for a scope statement.
std::string mangleQualifiersToString (const SgScopeStatement *scope)
SgName mangleQualifiers (const SgScopeStatement *scope)
std::string mangleTypesToString (const SgTypePtrList::const_iterator b, const SgTypePtrList::const_iterator e)
SgName mangleTypes (const SgTypePtrList::const_iterator b, const SgTypePtrList::const_iterator e)
std::string mangleFunctionNameToString (const std::string &s, const std::string &ret_type_name=std::string(""))
SgName mangleFunctionName (const SgName &n, const SgName &ret_type_name=SgName(""))
std::string mangleTemplateArgsToString (const SgTemplateArgumentPtrList::const_iterator b, const SgTemplateArgumentPtrList::const_iterator e)
std::string mangleTemplateToString (const std::string &templ_name, const SgTemplateArgumentPtrList &templ_args, const SgScopeStatement *scope)
SgName mangleTemplate (const SgName &templ_name, const SgTemplateArgumentPtrList &templ_args, const SgScopeStatement *scope)
 Mangles an instantiated template, returning an SgName object.
std::string mangleTemplateFunctionToString (const std::string &templ_name, const SgTemplateArgumentPtrList &templ_args, const SgFunctionType *func_type, const SgScopeStatement *scope)
SgName mangleTemplateFunction (const std::string &templ_name, const SgTemplateArgumentPtrList &templ_args, const SgFunctionType *func_type, const SgScopeStatement *scope)
std::string mangleSgValueExp (const SgBoolValExp *expr)
 Mangles a boolean expression.
std::string mangleValueExp (const SgValueExp *expr)
 Mangles a value expression, as used in a template argument.
std::string mangleExpression (const SgExpression *expr)
std::string mangleTranslationUnitQualifiers (const SgDeclarationStatement *decl)


Function Documentation

std::string replaceNonAlphaNum ( const std::string &  s  ) 

std::string trimSpaces ( const std::string &  s  ) 

Returns the input std::string stripped of leading and trailing spaces.

std::string joinMangledQualifiersToString ( const std::string &  base,
const std::string &  name 
)

Joins two sets of mangled qualifiers to form a new mangled qualifier.

SgName joinMangledQualifiers ( const SgName base,
const SgName name 
)

Joins two sets of mangled qualifiers to form a new mangled qualifier.

const SgFunctionDefinition* findRootFunc ( const SgScopeStatement scope  ) 

Returns the function definition containing the specified statement.

size_t getLocalScopeNum ( const SgFunctionDefinition func_def,
const SgScopeStatement target 
)

Returns a unique positive integer ID to an SgScopeStatement within a function definition.

This routine computes a preorder numbering of the SgScopeStatements in the subtree rooted at 'func_def', and returns the number assigned to the 'target' scope statement, or 0 if the target could not be found in 'func_def'.

std::string mangleLocalScopeToString ( const SgScopeStatement scope  ) 

Produces a mangled name for a scope statement.

std::string mangleQualifiersToString ( const SgScopeStatement scope  ) 

Mangles a chain of qualifiers followed from a given scope.

This routine starts at a given scope and collects all mangled scope names going 'up' through to global scope.

SgName mangleQualifiers ( const SgScopeStatement scope  ) 

Mangles a chain of qualifiers, returning an SgName object.

See also:
mangleQualifiersToStd::String

std::string mangleTypesToString ( const SgTypePtrList::const_iterator  b,
const SgTypePtrList::const_iterator  e 
)

Mangles a container of types, returning an STL std::string object.

Parameters:
[in] b First element in the container to mangle.
[in] e End (last+1) element in the container to mangle.
Returns:
An STL std::string containing all mangled names in the list, concatenated by "__sep__".

SgName mangleTypes ( const SgTypePtrList::const_iterator  b,
const SgTypePtrList::const_iterator  e 
)

Mangles a list of types, returning an SgName object.

See also:
mangleTypesToStd::String

std::string mangleFunctionNameToString ( const std::string &  s,
const std::string &  ret_type_name = std::string("") 
)

Returns a mangled form of special C++ function names (excl. qualifiers).

Adapted from SgType::mangledNameSupport. This routine considers these cases:

The caller may omit the second parameter to this function, but that is not recommended.

Parameters:
[in] s Unmangled function name.
[in] ret_type_name Return type of this function, as a mangled name.
Returns:
A mangled std::string name.

SgName mangleFunctionName ( const SgName n,
const SgName ret_type_name = SgName("") 
)

Returns a mangled form of a C++ function name, as an SgName object.

See also:
mangleFunctionNameToStd::String

std::string mangleTemplateArgsToString ( const SgTemplateArgumentPtrList::const_iterator  b,
const SgTemplateArgumentPtrList::const_iterator  e 
)

Mangles a template argument container, returning an STL std::string.

Parameters:
[in] b First element in the container to mangle.
[in] e End (last+1) in the container to mangle.
Returns:
The specified arguments mangled and concatenated by "__sep__".

std::string mangleTemplateToString ( const std::string &  templ_name,
const SgTemplateArgumentPtrList templ_args,
const SgScopeStatement scope 
)

Mangles an instantiated template.

Parameters:
[in] templ_name Unmangled base name of the template. This std::string should not contain the template arguments (i.e., should be 'foo' and not 'foo < int >').
[in] templ_args Container of template arguments.
[in] scope Scope of the function (e.g., via 'get_scope ()'), used to get qualifiers.
Returns:
Mangled name, including all parameter information.

SgName mangleTemplate ( const SgName templ_name,
const SgTemplateArgumentPtrList templ_args,
const SgScopeStatement scope 
)

Mangles an instantiated template, returning an SgName object.

std::string mangleTemplateFunctionToString ( const std::string &  templ_name,
const SgTemplateArgumentPtrList templ_args,
const SgFunctionType func_type,
const SgScopeStatement scope 
)

Mangles an instantiated template function or template member function.

Parameters:
[in] templ_name Unmangled base name of the function. This std::string should not contain the template arguments (i.e., should be 'foo' and not 'foo < int >').
[in] templ_args Container of template arguments.
[in] func_type The function's type (e.g., via 'get_type ()')
[in] scope Scope of the function (e.g., via 'get_scope ()'), used to get qualifiers.
Returns:
Mangled name, including all parameter information.

SgName mangleTemplateFunction ( const std::string &  templ_name,
const SgTemplateArgumentPtrList templ_args,
const SgFunctionType func_type,
const SgScopeStatement scope 
)

Mangles an instantiated template function or member function, returning a SgName object.

See also:
mangleTemplateFunctionToStd::String

std::string mangleSgValueExp ( const SgBoolValExp expr  ) 

Mangles a boolean expression.

std::string mangleValueExp ( const SgValueExp expr  ) 

Mangles a value expression, as used in a template argument.

std::string mangleExpression ( const SgExpression expr  ) 

Mangles a constant expression, needed for template arguments.

Todo:
Find a better way to deal with general template expression arguments.

std::string mangleTranslationUnitQualifiers ( const SgDeclarationStatement decl  ) 

If the declaration has translation unit scope (as opposed to program scope), mangle the translation unit name.


Generated on Sat May 19 00:53:55 2012 for ROSE by  doxygen 1.4.7