5#ifndef CPROVER_GOTO_PROGRAMS_NAME_MANGLER_H
6#define CPROVER_GOTO_PROGRAMS_NAME_MANGLER_H
16#define FILE_LOCAL_PREFIX CPROVER_PREFIX "file_local_"
29template <
class MangleFun>
54 std::vector<symbol_tablet::symbolst::const_iterator>
old_syms;
64 if(
sym.value.is_nil())
66 if(!
sym.is_file_local)
98 if(rename(e) && rename(t))
108 if(!
fun.second.body_available())
110 for(
auto &
ins :
fun.second.body.instructions)
112 rename(
ins.code_nonconst());
113 if(
ins.has_condition())
114 rename(
ins.condition_nonconst());
124 "There should exist an entry in the function_map for the original name "
125 "of the function that we renamed '" +
126 std::string(
pair.first.c_str()) +
"'");
131 log.
debug() <<
"Found a mangled name that already exists: "
132 << std::string(
pair.second.c_str()) <<
log.
eom;
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
Mangle identifiers by hashing their working directory with djb2 hash.
irep_idt operator()(const symbolt &, const std::string &)
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Base class for all expressions.
Mangle identifiers by including their filename.
irep_idt operator()(const symbolt &, const std::string &)
const std::regex multi_under
const std::regex forbidden
Mangles the names in an entire program and its symbol table.
void mangle()
Mangle all file-local function symbols in the program.
const std::string & extra_info
function_name_manglert(message_handlert &mh, goto_modelt &gm, const std::string &extra_info)
function_mapt function_map
symbol_tablet symbol_table
Symbol table.
goto_functionst goto_functions
GOTO functions.
Class that provides messages with a built-in verbosity 'level'.
void insert(const class symbol_exprt &old_expr, const class symbol_exprt &new_expr)
const symbolst & symbols
Read-only field, used to look up symbols given their names.
virtual void erase(const symbolst::const_iterator &entry) override
Remove a symbol from the symbol table.
virtual iteratort begin() override
virtual iteratort end() override
virtual std::pair< symbolt &, bool > insert(symbolt symbol) override
Author: Diffblue Ltd.
The type of an expression, extends irept.
#define INVARIANT(CONDITION, REASON)
This macro uses the wrapper function 'invariant_violated_string'.