@@ -49,40 +49,42 @@ void goto_inline(
49
49
50
50
typedef goto_functionst::goto_functiont goto_functiont;
51
51
52
- // find entry point
53
- goto_functionst::function_mapt::iterator it=
54
- goto_functions.function_map .find (goto_functionst::entry_point ());
52
+ // find entry point
53
+ goto_functionst::function_mapt::iterator it=
54
+ goto_functions.function_map .find (goto_functionst::entry_point ());
55
55
56
- if (it==goto_functions.function_map .end ())
57
- return ;
56
+ if (it==goto_functions.function_map .end ())
57
+ return ;
58
58
59
- goto_functiont &goto_function=it->second ;
60
- assert (goto_function.body_available ());
59
+ goto_functiont &goto_function=it->second ;
60
+ DATA_INVARIANT (
61
+ goto_function.body_available (),
62
+ " body of entry point function must be available" );
61
63
62
- // gather all calls
63
- // we use non-transitive inlining to avoid the goto program
64
- // copying that goto_inlinet would do otherwise
65
- goto_inlinet::inline_mapt inline_map;
64
+ // gather all calls
65
+ // we use non-transitive inlining to avoid the goto program
66
+ // copying that goto_inlinet would do otherwise
67
+ goto_inlinet::inline_mapt inline_map;
66
68
67
- Forall_goto_functions (f_it, goto_functions)
68
- {
69
- goto_functiont &goto_function=f_it->second ;
69
+ Forall_goto_functions (f_it, goto_functions)
70
+ {
71
+ goto_functiont &goto_function=f_it->second ;
70
72
71
- if (!goto_function.body_available ())
72
- continue ;
73
+ if (!goto_function.body_available ())
74
+ continue ;
73
75
74
- goto_inlinet::call_listt &call_list=inline_map[f_it->first ];
76
+ goto_inlinet::call_listt &call_list=inline_map[f_it->first ];
75
77
76
- goto_programt &goto_program=goto_function.body ;
78
+ goto_programt &goto_program=goto_function.body ;
77
79
78
- Forall_goto_program_instructions (i_it, goto_program)
79
- {
80
- if (!goto_inlinet::is_call ( i_it))
81
- continue ;
80
+ Forall_goto_program_instructions (i_it, goto_program)
81
+ {
82
+ if (!i_it-> is_function_call ( ))
83
+ continue ;
82
84
83
- call_list.push_back (goto_inlinet::callt (i_it, false ));
84
- }
85
+ call_list.push_back (goto_inlinet::callt (i_it, false ));
85
86
}
87
+ }
86
88
87
89
goto_inline.goto_inline (
88
90
goto_functionst::entry_point (), goto_function, inline_map, true );
@@ -164,14 +166,13 @@ void goto_partial_inline(
164
166
165
167
Forall_goto_program_instructions (i_it, goto_program)
166
168
{
167
- if (!goto_inlinet::is_call ( i_it))
169
+ if (!i_it-> is_function_call ( ))
168
170
continue ;
169
171
170
172
exprt lhs;
171
173
exprt function_expr;
172
174
exprt::operandst arguments;
173
- exprt constrain;
174
- goto_inlinet::get_call (i_it, lhs, function_expr, arguments, constrain);
175
+ goto_inlinet::get_call (i_it, lhs, function_expr, arguments);
175
176
176
177
if (function_expr.id ()!=ID_symbol)
177
178
// Can't handle pointers to functions
@@ -199,7 +200,7 @@ void goto_partial_inline(
199
200
if (goto_function.is_inlined () ||
200
201
goto_program.instructions .size ()<=smallfunc_limit)
201
202
{
202
- assert ( goto_inlinet::is_call ( i_it) );
203
+ INVARIANT ( i_it-> is_function_call (), " is a call " );
203
204
call_list.push_back (goto_inlinet::callt (i_it, false ));
204
205
}
205
206
}
@@ -273,7 +274,7 @@ void goto_function_inline(
273
274
274
275
Forall_goto_program_instructions (i_it, goto_program)
275
276
{
276
- if (!goto_inlinet::is_call ( i_it))
277
+ if (!i_it-> is_function_call ( ))
277
278
continue ;
278
279
279
280
call_list.push_back (goto_inlinet::callt (i_it, true ));
@@ -318,7 +319,7 @@ jsont goto_function_inline_and_log(
318
319
319
320
Forall_goto_program_instructions (i_it, goto_program)
320
321
{
321
- if (!goto_inlinet::is_call ( i_it))
322
+ if (!i_it-> is_function_call ( ))
322
323
continue ;
323
324
324
325
call_list.push_back (goto_inlinet::callt (i_it, true ));
0 commit comments