Go to the documentation of this file.
27 std::vector<const symbolt *> working_set;
29 working_set.push_back(&in_symbol);
31 while(!working_set.empty())
33 const symbolt *current_symbol_ptr = working_set.back();
34 working_set.pop_back();
35 const symbolt &symbol = *current_symbol_ptr;
37 if(!dest.insert(symbol.
name).second)
45 for(
const auto &s : new_symbols)
46 working_set.push_back(&ns.
lookup(s));
48 if(symbol.
type.
id() == ID_code)
53 for(
const auto &p : parameters)
57 if(!ns.
lookup(p.get_identifier(), s))
58 working_set.push_back(s);
82 special.insert(
"argc'");
83 special.insert(
"argv'");
84 special.insert(
"envp'");
85 special.insert(
"envp_size'");
93 for(symbol_tablet::symbolst::const_iterator
94 it=symbol_table.
symbols.begin();
99 if(exported.find(it->first)!=exported.end())
103 const symbolt &symbol=it->second;
105 if(special.find(symbol.
name)!=special.end())
111 bool is_function=symbol.
type.
id()==ID_code;
115 bool has_initializer=
120 if(symbol.
mode==ID_C && is_function && is_file_local)
143 if((has_initializer || !symbol.
is_extern) &&
152 for(symbol_tablet::symbolst::const_iterator
153 it=symbol_table.
symbols.begin();
154 it!=symbol_table.
symbols.end();
157 if(exported.find(it->first)==exported.end())
159 symbol_tablet::symbolst::const_iterator next=std::next(it);
160 symbol_table.
erase(it);
const char * c_str() const
void find_type_and_expr_symbols(const exprt &src, find_symbols_sett &dest)
std::vector< parametert > parameterst
typet type
Type of symbol.
void remove_internal_symbols(symbol_tablet &symbol_table)
Removes internal symbols from a symbol table A symbol is EXPORTED if it is a.
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
bool lookup(const irep_idt &name, const symbolt *&symbol) const override
See documentation for namespace_baset::lookup().
bool get_bool(const irep_namet &name) const
const code_typet & to_code_type(const typet &type)
Cast a typet to a code_typet.
irep_idt mode
Language mode.
#define INITIALIZE_FUNCTION
const irep_idt & id() const
static void get_symbols(const namespacet &ns, const symbolt &in_symbol, find_symbols_sett &dest)
const parameterst & parameters() const
exprt value
Initial value of symbol.
std::unordered_set< irep_idt > find_symbols_sett
const typet & return_type() const
virtual void erase(const symbolst::const_iterator &entry) override
Remove a symbol from the symbol table.
irep_idt name
The unique identifier.