@@ -329,14 +329,11 @@ std::list<exprt> expressions_read(
329
329
break ;
330
330
331
331
case FUNCTION_CALL:
332
- {
333
- const code_function_callt &function_call = instruction.get_function_call ();
334
- for (const auto &argument : function_call.arguments ())
332
+ for (const auto &argument : instruction.call_arguments ())
335
333
dest.push_back (argument);
336
- if (function_call. lhs ().is_not_nil ())
337
- parse_lhs_read (function_call. lhs (), dest);
334
+ if (instruction. call_lhs ().is_not_nil ())
335
+ parse_lhs_read (instruction. call_lhs (), dest);
338
336
break ;
339
- }
340
337
341
338
case ASSIGN:
342
339
dest.push_back (instruction.assign_rhs ());
@@ -371,12 +368,8 @@ std::list<exprt> expressions_written(
371
368
switch (instruction.type )
372
369
{
373
370
case FUNCTION_CALL:
374
- {
375
- const code_function_callt &function_call =
376
- instruction.get_function_call ();
377
- if (function_call.lhs ().is_not_nil ())
378
- dest.push_back (function_call.lhs ());
379
- }
371
+ if (instruction.call_lhs ().is_not_nil ())
372
+ dest.push_back (instruction.call_lhs ());
380
373
break ;
381
374
382
375
case ASSIGN:
@@ -999,35 +992,20 @@ void goto_programt::instructiont::transform(
999
992
1000
993
case FUNCTION_CALL:
1001
994
{
1002
- auto new_call = get_function_call ();
1003
- bool change = false ;
1004
-
1005
- auto new_lhs = f (new_call.lhs ());
995
+ auto new_lhs = f (call_lhs ());
1006
996
if (new_lhs.has_value ())
1007
- {
1008
- new_call.lhs () = *new_lhs;
1009
- change = true ;
1010
- }
997
+ call_lhs () = *new_lhs;
1011
998
1012
- auto new_function = f (new_call.function ());
1013
- if (new_function.has_value ())
1014
- {
1015
- new_call.function () = *new_function;
1016
- change = true ;
1017
- }
999
+ auto new_call_function = f (call_function ());
1000
+ if (new_call_function.has_value ())
1001
+ call_function () = *new_call_function;
1018
1002
1019
- for (auto &a : new_call. arguments ())
1003
+ for (auto &a : call_arguments ())
1020
1004
{
1021
1005
auto new_a = f (a);
1022
1006
if (new_a.has_value ())
1023
- {
1024
1007
a = *new_a;
1025
- change = true ;
1026
- }
1027
1008
}
1028
-
1029
- if (change)
1030
- set_function_call (new_call);
1031
1009
}
1032
1010
break ;
1033
1011
@@ -1082,13 +1060,10 @@ void goto_programt::instructiont::apply(
1082
1060
break ;
1083
1061
1084
1062
case FUNCTION_CALL:
1085
- {
1086
- const auto &call = get_function_call ();
1087
- f (call.lhs ());
1088
- for (auto &a : call.arguments ())
1063
+ f (call_lhs ());
1064
+ for (auto &a : call_arguments ())
1089
1065
f (a);
1090
- }
1091
- break ;
1066
+ break ;
1092
1067
1093
1068
case GOTO:
1094
1069
case ASSUME:
0 commit comments