@@ -228,9 +228,8 @@ goto_programt::targett remove_virtual_functionst::remove_virtual_function(
228
228
// match any expected type:
229
229
if (fallback_action==virtual_dispatch_fallback_actiont::ASSUME_FALSE)
230
230
{
231
- auto newinst=new_code_calls.add_instruction (ASSUME);
232
- newinst->guard =false_exprt ();
233
- newinst->source_location =vcall_source_loc;
231
+ new_code_calls.add (
232
+ goto_programt::make_assumption (false_exprt (), vcall_source_loc));
234
233
}
235
234
236
235
// get initial identifier for grouping
@@ -250,29 +249,34 @@ goto_programt::targett remove_virtual_functionst::remove_virtual_function(
250
249
// Only create one call sequence per possible target:
251
250
if (insertit.second )
252
251
{
253
- goto_programt::targett t1=new_code_calls.add_instruction ();
254
- t1->source_location =vcall_source_loc;
255
252
if (fun.symbol_expr .has_value ())
256
253
{
257
- // call function
258
- t1->make_function_call (code);
254
+ // call function
255
+ goto_programt::targett t1 = new_code_calls.add (
256
+ goto_programt::make_function_call (code, vcall_source_loc));
257
+
259
258
create_static_function_call (
260
259
t1->get_function_call (), *fun.symbol_expr , ns);
260
+
261
+ insertit.first ->second = t1;
261
262
}
262
263
else
263
264
{
265
+ goto_programt::targett t1 = new_code_calls.add (
266
+ goto_programt::make_assertion (false_exprt (), vcall_source_loc));
267
+
264
268
// No definition for this type; shouldn't be possible...
265
- t1->make_assertion (false_exprt ());
266
269
t1->source_location .set_comment (
267
270
" cannot find calls for " +
268
271
id2string (code.function ().get (ID_identifier)) + " dispatching " +
269
272
id2string (fun.class_id ));
273
+
274
+ insertit.first ->second = t1;
270
275
}
271
- insertit. first -> second =t1;
276
+
272
277
// goto final
273
- goto_programt::targett t3=new_code_calls.add_instruction ();
274
- t3->source_location =vcall_source_loc;
275
- t3->make_goto (t_final, true_exprt ());
278
+ new_code_calls.add (
279
+ goto_programt::make_goto (t_final, true_exprt (), vcall_source_loc));
276
280
}
277
281
278
282
// Fall through to the default callee if possible:
@@ -308,9 +312,8 @@ goto_programt::targett remove_virtual_functionst::remove_virtual_function(
308
312
}
309
313
else
310
314
{
311
- goto_programt::targett new_goto = new_code_gotos.add_instruction ();
312
- new_goto->source_location = vcall_source_loc;
313
- new_goto->make_goto (insertit.first ->second , class_id_test);
315
+ new_code_gotos.add (goto_programt::make_goto (
316
+ insertit.first ->second , class_id_test, vcall_source_loc));
314
317
}
315
318
}
316
319
}
0 commit comments