31 if(ns.
lookup(new_name, symbol))
34 std::string prefix=
id2string(new_name)+
"_";
36 new_name=prefix+std::to_string(ns.
get_max(prefix)+1);
47 if(expr.
id()==ID_symbol)
49 if(expr.
get(ID_identifier)==old_name)
51 expr.
set(ID_identifier, new_name);
57 if(expr.
id()==ID_address_of)
63 if(!
rename(*it, old_name, new_name))
irep_idt name
The unique identifier.
virtual bool lookup(const irep_idt &name, const symbolt *&symbol) const
const std::string & id2string(const irep_idt &d)
Symbol table entry.This is a symbol in the symbol table, stored in an object of type symbol_tablet...
const irep_idt & id() const
bool rename(exprt &expr, const irep_idt &old_name, const irep_idt &new_name)
automated variable renaming
const irep_idt & get(const irep_namet &name) const
Base class for all expressions.
#define Forall_operands(it, expr)
void get_new_name(symbolt &symbol, const namespacet &ns)
automated variable renaming
virtual unsigned get_max(const std::string &prefix) const
void set(const irep_namet &name, const irep_idt &value)