25 const std::string &module,
31 for(
const auto &symbol_name_entry :
34 symbol_table_baset::symbolst::const_iterator it2 =
35 symbol_table.
symbols.find(symbol_name_entry.second);
37 if(it2==symbol_table.
symbols.end())
45 symbolptr_list.push_back(&s);
48 if(symbolptr_list.empty())
53 else if(symbolptr_list.size()>=2)
55 message.
error() <<
"module '" << module <<
"' does not uniquely resolve:\n";
57 for(
const symbolt *symbol_ptr : symbolptr_list)
58 message.
error() <<
" " << symbol_ptr->name <<
'\n';
66 return *symbolptr_list.front();
71 const std::string &module,
80 for(
const auto &symbol_pair : symbol_table.
symbols)
82 const symbolt &s = symbol_pair.second;
91 symbolptr_list.push_back(&s);
94 if(symbolptr_list.empty())
99 else if(symbolptr_list.size()>=2)
102 std::set<std::string> modules;
104 for(
const symbolt *symbol_ptr : symbolptr_list)
105 modules.insert(
id2string(symbol_ptr->pretty_name));
107 message.
error() <<
"multiple modules found, please select one:\n";
109 for(
const auto &s_it : modules)
110 message.
error() <<
" " << s_it <<
'\n';
118 const symbolt &symbol=*symbolptr_list.front();
const irep_idt & id() const
Class that provides messages with a built-in verbosity 'level'.
mstreamt & status() const
The symbol table base class interface.
const symbol_base_mapt & symbol_base_map
Read-only field, used to look up symbol names given their base names.
const symbolst & symbols
Read-only field, used to look up symbols given their names.
irep_idt base_name
Base (non-scoped) name.
typet type
Type of symbol.
irep_idt pretty_name
Language-specific display name.
std::list< const symbolt * > symbolptr_listt
const symbolt & get_module(const symbol_table_baset &symbol_table, const std::string &module, message_handlert &message_handler)
const symbolt & get_module_by_name(const symbol_table_baset &symbol_table, const std::string &module, message_handlert &message_handler)
Find module symbol using name.
const std::string & id2string(const irep_idt &d)
Ranges: pair of begin and end iterators, which can be initialized from containers,...
ranget< typename multimapt::const_iterator > equal_range(const multimapt &multimap, const typename multimapt::key_type &key)
Utility function to make equal_range method of multimap easier to use by returning a ranget object.