File tree 4 files changed +13
-28
lines changed 4 files changed +13
-28
lines changed Original file line number Diff line number Diff line change @@ -125,22 +125,23 @@ bool static_simplifier(
125
125
}
126
126
else if (i_it->is_function_call ())
127
127
{
128
- auto fcall = i_it->get_function_call ();
128
+ // copy
129
+ auto call_function = as_const (*i_it).call_function ();
130
+ auto call_arguments = as_const (*i_it).call_arguments ();
129
131
130
132
bool unchanged =
131
- ai.abstract_state_before (i_it)->ai_simplify (fcall. function () , ns);
133
+ ai.abstract_state_before (i_it)->ai_simplify (call_function , ns);
132
134
133
- exprt::operandst &args=fcall.arguments ();
134
-
135
- for (auto &o : args)
135
+ for (auto &o : call_arguments)
136
136
unchanged &= ai.abstract_state_before (i_it)->ai_simplify (o, ns);
137
137
138
138
if (unchanged)
139
139
unmodified.function_calls ++;
140
140
else
141
141
{
142
142
simplified.function_calls ++;
143
- i_it->set_function_call (fcall);
143
+ i_it->call_function () = std::move (call_function);
144
+ i_it->call_arguments () = std::move (call_arguments);
144
145
}
145
146
}
146
147
}
Original file line number Diff line number Diff line change @@ -70,12 +70,11 @@ void replace_callst::operator()(
70
70
if (!ins.is_function_call ())
71
71
continue ;
72
72
73
- auto cfc = ins.get_function_call ();
74
- exprt &function = cfc.function ();
73
+ const exprt &function = ins.call_function ();
75
74
76
75
PRECONDITION (function.id () == ID_symbol);
77
76
78
- symbol_exprt &se = to_symbol_expr (function);
77
+ const symbol_exprt &se = to_symbol_expr (function);
79
78
const irep_idt &id = se.get_identifier ();
80
79
81
80
auto f_it1 = goto_functions.function_map .find (id);
@@ -109,10 +108,8 @@ void replace_callst::operator()(
109
108
}
110
109
111
110
// Finally modify the call
112
- function.type () = ns.lookup (f_it2->first ).type ;
113
- se.set_identifier (new_id);
114
-
115
- ins.set_function_call (cfc);
111
+ ins.call_function ().type () = ns.lookup (f_it2->first ).type ;
112
+ to_symbol_expr (ins.call_function ()).set_identifier (new_id);
116
113
}
117
114
}
118
115
Original file line number Diff line number Diff line change @@ -327,20 +327,6 @@ class goto_programt
327
327
return to_code_function_call (code).arguments ();
328
328
}
329
329
330
- // / Set the function call for FUNCTION_CALL
331
- #if 1
332
- DEPRECATED (SINCE(
333
- 2021 ,
334
- 2 ,
335
- 24 ,
336
- " Use call_function(), call_lhs(), call_arguments() instead" ))
337
- void set_function_call(code_function_callt c)
338
- {
339
- PRECONDITION (is_function_call ());
340
- code = std::move (c);
341
- }
342
- #endif
343
-
344
330
// / Get the statement for OTHER
345
331
const codet &get_other () const
346
332
{
Original file line number Diff line number Diff line change @@ -291,7 +291,8 @@ static goto_programt::targett replace_virtual_function_with_dispatch_table(
291
291
{
292
292
auto c = target->get_function_call ();
293
293
create_static_function_call (c, *functions.front ().symbol_expr , ns);
294
- target->set_function_call (c);
294
+ target->call_function () = c.function ();
295
+ target->call_arguments () = c.arguments ();
295
296
}
296
297
return next_target;
297
298
}
You can’t perform that action at this time.
0 commit comments