20 std::pair<symbolst::iterator, bool> result=
22 symbolt &new_symbol=result.first->second;
27 symbol_base_mapt::iterator base_result=
45 return std::make_pair(std::ref(new_symbol), result.second);
72 std::pair<symbolt &, bool> result=
insert(std::move(temp_symbol));
77 result.first.swap(symbol);
80 new_symbol=&result.first;
81 return !result.second;
88 const symbolt &symbol=entry->second;
90 symbol_base_mapt::const_iterator
92 symbol_base_mapt::const_iterator
94 while(base_it!=base_it_end && base_it->second!=symbol.
name)
98 "symbolt::base_name should not be changed "
99 "after it is added to the symbol_table "
104 symbol_module_mapt::const_iterator
107 while(module_it!=module_it_end && module_it->second!=symbol.
name)
110 module_it!=module_it_end,
111 "symbolt::module should not be changed "
112 "after it is added to the symbol_table "
126 for(
const auto &elem :
symbols)
128 const auto symbol_key = elem.first;
129 const auto &symbol = elem.second;
133 vm, symbol.is_well_formed(),
"Symbol is malformed: ", symbol_key);
138 symbol.name == symbol_key,
139 "Symbol table entry must map to a symbol with the correct identifier",
140 "Symbol table key '",
142 "' maps to symbol '",
147 if(!symbol.base_name.empty())
149 const auto base_map_search =
151 const bool base_map_matches_symbol =
153 base_map_search.first,
154 base_map_search.second,
155 [&symbol_key](
const typename symbol_base_mapt::value_type &match) {
156 return match.second == symbol_key;
161 base_map_matches_symbol,
162 "The base_name of a symbol should map to itself",
163 "Symbol table key '",
165 "' has a base_name '",
167 "' which does not map to itself");
171 if(!symbol.module.empty())
174 bool module_map_matches_symbol =
176 module_map_search.first,
177 module_map_search.second,
178 [&symbol_key](
const typename symbol_module_mapt::value_type &match) {
179 return match.second == symbol_key;
184 module_map_matches_symbol,
185 "Symbol table module map should map to symbol",
186 "Symbol table key '",
188 "' has a module name of '",
190 "' which does not map to itself");
200 "Symbol table base_name map entries must map to a symbol name",
201 "base_name map entry '",
202 base_map_entry.first,
203 "' maps to non-existant symbol name '",
204 base_map_entry.second,
214 "Symbol table module map entries must map to a symbol name",
215 "base_name map entry '",
216 module_map_entry.first,
217 "' maps to non-existant symbol name '",
218 module_map_entry.second,