@@ -34,7 +34,7 @@ void goto_inlinet::parameter_assignments(
34
34
const exprt::operandst &arguments, // arguments of call
35
35
goto_programt &dest)
36
36
{
37
- assert (is_call ( target));
37
+ assert (target-> is_function_call ( ));
38
38
assert (dest.empty ());
39
39
40
40
const source_locationt &source_location=target->source_location ;
@@ -160,7 +160,7 @@ void goto_inlinet::parameter_destruction(
160
160
const code_typet &code_type, // type of called function
161
161
goto_programt &dest)
162
162
{
163
- assert (is_call ( target));
163
+ assert (target-> is_function_call ( ));
164
164
assert (dest.empty ());
165
165
166
166
const source_locationt &source_location=target->source_location ;
@@ -195,8 +195,7 @@ void goto_inlinet::parameter_destruction(
195
195
196
196
void goto_inlinet::replace_return (
197
197
goto_programt &dest, // inlining this
198
- const exprt &lhs, // lhs in caller
199
- const exprt &constrain)
198
+ const exprt &lhs) // lhs in caller
200
199
{
201
200
for (goto_programt::instructionst::iterator
202
201
it=dest.instructions .begin ();
@@ -231,14 +230,6 @@ void goto_inlinet::replace_return(
231
230
assignment->source_location=it->source_location;
232
231
assignment->function=it->function;
233
232
234
- if(constrain.is_not_nil() && !constrain.is_true())
235
- {
236
- codet constrain(ID_bp_constrain);
237
- constrain.reserve_operands(2);
238
- constrain.move_to_operands(assignment->code);
239
- constrain.copy_to_operands(constrain);
240
- }
241
-
242
233
dest.insert_before_swap(it, *assignment);
243
234
it++;
244
235
}
@@ -276,20 +267,8 @@ void goto_inlinet::replace_return(
276
267
code_assign.rhs ().type ())
277
268
code_assign.rhs ().make_typecast (code_assign.lhs ().type ());
278
269
279
- if (constrain.is_not_nil () && !constrain.is_true ())
280
- {
281
- codet constrain (ID_bp_constrain);
282
- constrain.reserve_operands (2 );
283
- constrain.move_to_operands (code_assign);
284
- constrain.copy_to_operands (constrain);
285
- it->code =constrain;
286
- it->type =OTHER;
287
- }
288
- else
289
- {
290
- it->code =code_assign;
291
- it->type =ASSIGN;
292
- }
270
+ it->code =code_assign;
271
+ it->type =ASSIGN;
293
272
294
273
it++;
295
274
}
@@ -346,10 +325,9 @@ void goto_inlinet::insert_function_body(
346
325
goto_programt::targett target,
347
326
const exprt &lhs,
348
327
const symbol_exprt &function,
349
- const exprt::operandst &arguments,
350
- const exprt &constrain)
328
+ const exprt::operandst &arguments)
351
329
{
352
- assert (is_call ( target));
330
+ assert (target-> is_function_call ( ));
353
331
assert (!dest.empty ());
354
332
assert (goto_function.body_available ());
355
333
@@ -367,7 +345,7 @@ void goto_inlinet::insert_function_body(
367
345
for (auto &instruction : body.instructions )
368
346
instruction.function =target->function ;
369
347
370
- replace_return (body, lhs, constrain );
348
+ replace_return (body, lhs);
371
349
372
350
goto_programt tmp1;
373
351
parameter_assignments (
@@ -448,7 +426,7 @@ void goto_inlinet::insert_function_nobody(
448
426
const symbol_exprt &function,
449
427
const exprt::operandst &arguments)
450
428
{
451
- assert (is_call ( target));
429
+ assert (target-> is_function_call ( ));
452
430
assert (!dest.empty ());
453
431
454
432
const irep_idt identifier=function.get_identifier ();
@@ -501,7 +479,7 @@ void goto_inlinet::expand_function_call(
501
479
const bool force_full,
502
480
goto_programt::targett target)
503
481
{
504
- assert (is_call ( target));
482
+ assert (target-> is_function_call ( ));
505
483
assert (!dest.empty ());
506
484
assert (!transitive || inline_map.empty ());
507
485
@@ -513,9 +491,8 @@ void goto_inlinet::expand_function_call(
513
491
exprt lhs;
514
492
exprt function_expr;
515
493
exprt::operandst arguments;
516
- exprt constrain;
517
494
518
- get_call (target, lhs, function_expr, arguments, constrain );
495
+ get_call (target, lhs, function_expr, arguments);
519
496
520
497
if (function_expr.id ()!=ID_symbol)
521
498
return ;
@@ -576,8 +553,7 @@ void goto_inlinet::expand_function_call(
576
553
target,
577
554
lhs,
578
555
function,
579
- arguments,
580
- constrain);
556
+ arguments);
581
557
582
558
progress () << " Inserting " << identifier << " into caller" << eom;
583
559
progress () << " Number of instructions: "
@@ -609,8 +585,7 @@ void goto_inlinet::expand_function_call(
609
585
target,
610
586
lhs,
611
587
function,
612
- arguments,
613
- constrain);
588
+ arguments);
614
589
}
615
590
}
616
591
else // no body available
@@ -623,45 +598,15 @@ void goto_inlinet::get_call(
623
598
goto_programt::const_targett it,
624
599
exprt &lhs,
625
600
exprt &function,
626
- exprt::operandst &arguments,
627
- exprt &constrain)
601
+ exprt::operandst &arguments)
628
602
{
629
- assert (is_call (it));
630
-
631
- if (it->is_function_call ())
632
- {
633
- const code_function_callt &call=to_code_function_call (it->code );
603
+ assert (it->is_function_call ());
634
604
635
- lhs=call.lhs ();
636
- function=call.function ();
637
- arguments=call.arguments ();
638
- constrain=static_cast <const exprt &>(get_nil_irep ());
639
- }
640
- else
641
- {
642
- assert (is_bp_call (it));
643
-
644
- lhs=it->code .op0 ().op0 ();
645
- function=to_symbol_expr (it->code .op0 ().op1 ().op0 ());
646
- arguments=it->code .op0 ().op1 ().op1 ().operands ();
647
- constrain=it->code .op1 ();
648
- }
649
- }
650
-
651
- bool goto_inlinet::is_call (goto_programt::const_targett it)
652
- {
653
- return it->is_function_call () || is_bp_call (it);
654
- }
655
-
656
- bool goto_inlinet::is_bp_call (goto_programt::const_targett it)
657
- {
658
- if (!it->is_other ())
659
- return false ;
605
+ const code_function_callt &call=to_code_function_call (it->code );
660
606
661
- return it->code .get (ID_statement)==ID_bp_constrain &&
662
- it->code .operands ().size ()==2 &&
663
- it->code .op0 ().operands ().size ()==2 &&
664
- it->code .op0 ().op1 ().get (ID_statement)==ID_function_call;
607
+ lhs=call.lhs ();
608
+ function=call.function ();
609
+ arguments=call.arguments ();
665
610
}
666
611
667
612
void goto_inlinet::goto_inline (
@@ -782,7 +727,7 @@ const goto_inlinet::goto_functiont &goto_inlinet::goto_inline_transitive(
782
727
783
728
Forall_goto_program_instructions (i_it, goto_program)
784
729
{
785
- if (is_call ( i_it))
730
+ if (i_it-> is_function_call ( ))
786
731
call_list.push_back (i_it);
787
732
}
788
733
@@ -855,7 +800,7 @@ bool goto_inlinet::check_inline_map(
855
800
if (static_cast <int >(target->location_number )<=ln)
856
801
return false ;
857
802
858
- if (!is_call ( target))
803
+ if (!target-> is_function_call ( ))
859
804
return false ;
860
805
861
806
ln=target->location_number ;
0 commit comments