CBMC
function_name_manglert< MangleFun > Class Template Reference

Mangles the names in an entire program and its symbol table. More...

#include <name_mangler.h>

+ Collaboration diagram for function_name_manglert< MangleFun >:

Public Member Functions

 function_name_manglert (message_handlert &mh, goto_modelt &gm, const std::string &extra_info)
 
void mangle ()
 Mangle all file-local function symbols in the program. More...
 

Protected Attributes

messaget log
 
goto_modeltmodel
 
MangleFun mangle_fun
 
const std::string & extra_info
 

Detailed Description

template<class MangleFun>
class function_name_manglert< MangleFun >

Mangles the names in an entire program and its symbol table.

The type parameter to this class should be a functor that has a no-arg constructor and an operator() override with the following signature:

irep_idt operator()(const symbolt &, const std::string &);

The return type doesn't actually have to be an irep_idt, just something that can be assigned to one. The function is expected to return the mangled name of its symbolt argument, incorporating the second argument into the mangled name if possible.

Definition at line 30 of file name_mangler.h.

Constructor & Destructor Documentation

◆ function_name_manglert()

template<class MangleFun >
function_name_manglert< MangleFun >::function_name_manglert ( message_handlert mh,
goto_modelt gm,
const std::string &  extra_info 
)
inline
Parameters
mhhandler to construct a log from
gmmangle all names in gm's symbol table and goto program
extra_infoa string to be included in each mangled name

Definition at line 36 of file name_mangler.h.

Member Function Documentation

◆ mangle()

template<class MangleFun >
void function_name_manglert< MangleFun >::mangle ( )
inline

Mangle all file-local function symbols in the program.

The way in which the symbols will be mangled is decided by which mangler type this object is instantiated with, e.g. DJB_manglert mangles the path name by hashing it.

Definition at line 49 of file name_mangler.h.

Member Data Documentation

◆ extra_info

template<class MangleFun >
const std::string& function_name_manglert< MangleFun >::extra_info
protected

Definition at line 142 of file name_mangler.h.

◆ log

template<class MangleFun >
messaget function_name_manglert< MangleFun >::log
mutableprotected

Definition at line 139 of file name_mangler.h.

◆ mangle_fun

template<class MangleFun >
MangleFun function_name_manglert< MangleFun >::mangle_fun
protected

Definition at line 141 of file name_mangler.h.

◆ model

template<class MangleFun >
goto_modelt& function_name_manglert< MangleFun >::model
protected

Definition at line 140 of file name_mangler.h.


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