@@ -120,10 +120,11 @@ void static_simplifiert<analyzerT>::simplify_program()
120
120
unsigned assumes;
121
121
unsigned gotos;
122
122
unsigned assigns;
123
+ unsigned function_calls;
123
124
};
124
125
125
- counters simplified = {0 ,0 ,0 ,0 };
126
- counters unmodified = {0 ,0 ,0 ,0 };
126
+ counters simplified = {0 ,0 ,0 ,0 , 0 };
127
+ counters unmodified = {0 ,0 ,0 ,0 , 0 };
127
128
128
129
Forall_goto_functions (f_it, goto_functions)
129
130
{
@@ -163,6 +164,30 @@ void static_simplifiert<analyzerT>::simplify_program()
163
164
assign.rhs () = simplified_rhs;
164
165
i_it->code = assign;
165
166
}
167
+ else if (i_it->is_function_call ())
168
+ {
169
+ unsigned result = 0 ;
170
+ code_function_callt fcall (to_code_function_call (i_it->code ));
171
+
172
+ exprt new_function = domain[i_it].domain_simplify (fcall.function (), ns);
173
+ result |= (new_function == fcall.function ()) ? 0 : 1 ;
174
+ fcall.function () = new_function;
175
+
176
+ exprt::operandst &args = fcall.arguments ();
177
+
178
+ for (exprt::operandst::iterator o_it = args.begin ();
179
+ o_it != args.end (); ++o_it)
180
+ {
181
+ exprt new_arg = domain[i_it].domain_simplify (*o_it, ns);
182
+ result |= (new_arg == *o_it) ? 0 : 1 ;
183
+ *o_it = new_arg;
184
+ }
185
+
186
+ i_it->code = fcall;
187
+
188
+ simplified.function_calls += result;
189
+ unmodified.function_calls += (1 - result);
190
+ }
166
191
}
167
192
}
168
193
@@ -175,12 +200,14 @@ void static_simplifiert<analyzerT>::simplify_program()
175
200
<< " , assume: " << simplified.assumes
176
201
<< " , goto: " << simplified.gotos
177
202
<< " , assigns: " << simplified.assigns
203
+ << " , function calls: " << simplified.function_calls
178
204
<< " \n "
179
205
<< " UNMODIFIED: "
180
206
<< " assert: " << unmodified.asserts
181
207
<< " , assume: " << unmodified.assumes
182
208
<< " , goto: " << unmodified.gotos
183
209
<< " , assigns: " << unmodified.assigns
210
+ << " , function calls: " << unmodified.function_calls
184
211
<< eom;
185
212
186
213
return ;
0 commit comments