@@ -151,9 +151,9 @@ void cpp_typecheckt::static_and_dynamic_initialization()
151
151
152
152
disable_access_control = true ;
153
153
154
- for (const auto &d_it : dynamic_initializations)
154
+ for (const irep_idt &d_it : dynamic_initializations)
155
155
{
156
- symbolt &symbol=symbol_table.symbols . find (d_it)-> second ;
156
+ const symbolt &symbol=* symbol_table.lookup (d_it);
157
157
158
158
if (symbol.is_extern )
159
159
continue ;
@@ -178,7 +178,7 @@ void cpp_typecheckt::static_and_dynamic_initialization()
178
178
179
179
// Make it nil to get zero initialization by
180
180
// __CPROVER_initialize
181
- symbol .value .make_nil ();
181
+ symbol_table. get_writeable (d_it)-> get () .value .make_nil ();
182
182
}
183
183
else
184
184
{
@@ -210,7 +210,7 @@ void cpp_typecheckt::static_and_dynamic_initialization()
210
210
init_symbol.is_type =false ;
211
211
init_symbol.is_macro =false ;
212
212
213
- symbol_table.move (init_symbol);
213
+ symbol_table.insert ( std:: move (init_symbol) );
214
214
215
215
disable_access_control=false ;
216
216
}
@@ -223,14 +223,15 @@ void cpp_typecheckt::do_not_typechecked()
223
223
{
224
224
cont = false ;
225
225
226
- Forall_symbols (s_it, symbol_table.symbols )
226
+ for ( const auto &named_symbol : symbol_table.symbols )
227
227
{
228
- symbolt &symbol=s_it-> second ;
228
+ const symbolt &symbol=named_symbol. second ;
229
229
230
230
if (symbol.value .id ()==" cpp_not_typechecked" &&
231
231
symbol.value .get_bool (" is_used" ))
232
232
{
233
233
assert (symbol.type .id ()==ID_code);
234
+ symbolt &symbol=*symbol_table.get_writeable (named_symbol.first );
234
235
235
236
if (symbol.base_name ==" operator=" )
236
237
{
@@ -256,37 +257,36 @@ void cpp_typecheckt::do_not_typechecked()
256
257
}
257
258
while (cont);
258
259
259
- Forall_symbols (s_it, symbol_table.symbols )
260
+ for ( const auto &named_symbol : symbol_table.symbols )
260
261
{
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 )->get ().value .make_nil ();
264
264
}
265
265
}
266
266
267
267
void cpp_typecheckt::clean_up ()
268
268
{
269
- symbol_tablet::symbolst::iterator it=symbol_table.symbols .begin ();
269
+ symbol_tablet::symbolst::const_iterator it=symbol_table.symbols .begin ();
270
270
271
271
while (it!=symbol_table.symbols .end ())
272
272
{
273
- symbol_tablet::symbolst::iterator cur_it = it;
273
+ symbol_tablet::symbolst::const_iterator cur_it = it;
274
274
it++;
275
275
276
- symbolt &symbol = cur_it->second ;
276
+ const symbolt &symbol= cur_it->second ;
277
277
278
278
// erase templates
279
279
if (symbol.type .get_bool (ID_is_template))
280
280
{
281
- symbol_table.symbols . erase (cur_it);
281
+ symbol_table.erase (cur_it);
282
282
continue ;
283
283
}
284
284
else if (symbol.type .id ()==ID_struct ||
285
285
symbol.type .id ()==ID_union)
286
286
{
287
287
// remove methods from 'components'
288
- struct_union_typet &struct_union_type=
289
- to_struct_union_type (symbol .type );
288
+ struct_union_typet &struct_union_type=to_struct_union_type (
289
+ symbol_table. get_writeable (cur_it-> first )-> get () .type );
290
290
291
291
const struct_union_typet::componentst &components=
292
292
struct_union_type.components ();
0 commit comments