@@ -151,9 +151,9 @@ void cpp_typecheckt::static_and_dynamic_initialization()
151151
152152 disable_access_control = true ;
153153
154- for (const auto &d_it : dynamic_initializations)
154+ for (const irep_idt &d_it : dynamic_initializations)
155155 {
156- symbolt &symbol=symbol_table.symbols . find (d_it)-> second ;
156+ const symbolt &symbol=symbol_table.lookup (d_it);
157157
158158 if (symbol.is_extern )
159159 continue ;
@@ -178,7 +178,7 @@ void cpp_typecheckt::static_and_dynamic_initialization()
178178
179179 // Make it nil to get zero initialization by
180180 // __CPROVER_initialize
181- symbol .value .make_nil ();
181+ symbol_table. get_writeable (d_it) .value .make_nil ();
182182 }
183183 else
184184 {
@@ -210,7 +210,7 @@ void cpp_typecheckt::static_and_dynamic_initialization()
210210 init_symbol.is_type =false ;
211211 init_symbol.is_macro =false ;
212212
213- symbol_table.move (init_symbol);
213+ symbol_table.insert ( std:: move (init_symbol) );
214214
215215 disable_access_control=false ;
216216}
@@ -223,14 +223,15 @@ void cpp_typecheckt::do_not_typechecked()
223223 {
224224 cont = false ;
225225
226- Forall_symbols (s_it, symbol_table.symbols )
226+ for ( const auto &named_symbol : symbol_table.symbols )
227227 {
228- symbolt &symbol=s_it-> second ;
228+ const symbolt &symbol=named_symbol. second ;
229229
230230 if (symbol.value .id ()==" cpp_not_typechecked" &&
231231 symbol.value .get_bool (" is_used" ))
232232 {
233233 assert (symbol.type .id ()==ID_code);
234+ symbolt &symbol=symbol_table.get_writeable (named_symbol.first );
234235
235236 if (symbol.base_name ==" operator=" )
236237 {
@@ -256,37 +257,36 @@ void cpp_typecheckt::do_not_typechecked()
256257 }
257258 while (cont);
258259
259- Forall_symbols (s_it, symbol_table.symbols )
260+ for ( const auto &named_symbol : symbol_table.symbols )
260261 {
261- symbolt &symbol=s_it->second ;
262- if (symbol.value .id ()==" cpp_not_typechecked" )
263- symbol.value .make_nil ();
262+ if (named_symbol.second .value .id ()==" cpp_not_typechecked" )
263+ symbol_table.get_writeable (named_symbol.first ).value .make_nil ();
264264 }
265265}
266266
267267void cpp_typecheckt::clean_up ()
268268{
269- symbol_tablet::symbolst::iterator it=symbol_table.symbols .begin ();
269+ symbol_tablet::symbolst::const_iterator it=symbol_table.symbols .begin ();
270270
271271 while (it!=symbol_table.symbols .end ())
272272 {
273- symbol_tablet::symbolst::iterator cur_it = it;
273+ symbol_tablet::symbolst::const_iterator cur_it = it;
274274 it++;
275275
276- symbolt &symbol = cur_it->second ;
276+ const symbolt &symbol= cur_it->second ;
277277
278278 // erase templates
279279 if (symbol.type .get_bool (ID_is_template))
280280 {
281- symbol_table.symbols . erase (cur_it);
281+ symbol_table.erase (cur_it);
282282 continue ;
283283 }
284284 else if (symbol.type .id ()==ID_struct ||
285285 symbol.type .id ()==ID_union)
286286 {
287287 // remove methods from 'components'
288288 struct_union_typet &struct_union_type=
289- to_struct_union_type (symbol .type );
289+ to_struct_union_type (symbol_table. get_writeable (cur_it-> first ) .type );
290290
291291 const struct_union_typet::componentst &components=
292292 struct_union_type.components ();
0 commit comments