16
16
#include " goto_inline_class.h"
17
17
#include " goto_model.h"
18
18
19
+ // / Inline every function call into the entry_point() function.
20
+ // / Then delete the bodies of all of the other functions.
21
+ // / This is pretty drastic and can result in a very large program.
22
+ // / Caller is responsible for calling update(), compute_loop_numbers(), etc.
23
+ // / \param goto_model: Source of the symbol table and function map to use.
24
+ // / \param message_handler: Message handler used by goto_inlinet.
25
+ // / \param adjust_function: Replace location in inlined function with call site.
19
26
void goto_inline (
20
27
goto_modelt &goto_model,
21
28
message_handlert &message_handler,
@@ -29,6 +36,14 @@ void goto_inline(
29
36
adjust_function);
30
37
}
31
38
39
+ // / Inline every function call into the entry_point() function.
40
+ // / Then delete the bodies of all of the other functions.
41
+ // / This is pretty drastic and can result in a very large program.
42
+ // / Caller is responsible for calling update(), compute_loop_numbers(), etc.
43
+ // / \param goto_functions: The function map to use.
44
+ // / \param ns : The namespace to use.
45
+ // / \param message_handler: Message handler used by goto_inlinet.
46
+ // / \param adjust_function: Replace location in inlined function with call site.
32
47
void goto_inline (
33
48
goto_functionst &goto_functions,
34
49
const namespacet &ns,
@@ -96,11 +111,14 @@ void goto_inline(
96
111
97
112
// / Inline all function calls to functions either marked as "inlined" or
98
113
// / smaller than smallfunc_limit (by instruction count).
114
+ // / Unlike the goto_inline functions, this doesn't remove function
115
+ // / bodies after inlining.
116
+ // / Caller is responsible for calling update(), compute_loop_numbers(), etc.
99
117
// / \param goto_model: Source of the symbol table and function map to use.
100
118
// / \param message_handler: Message handler used by goto_inlinet.
101
119
// / \param smallfunc_limit: The maximum number of instructions in functions to
102
120
// / be inlined.
103
- // / \param adjust_function: Tell goto_inlinet to adjust function.
121
+ // / \param adjust_function: Replace location in inlined function with call site .
104
122
void goto_partial_inline (
105
123
goto_modelt &goto_model,
106
124
message_handlert &message_handler,
@@ -118,13 +136,16 @@ void goto_partial_inline(
118
136
119
137
// / Inline all function calls to functions either marked as "inlined" or
120
138
// / smaller than smallfunc_limit (by instruction count).
139
+ // / Unlike the goto_inline functions, this doesn't remove function
140
+ // / bodies after inlining.
141
+ // / Caller is responsible for calling update(), compute_loop_numbers(), etc.
121
142
// / \param goto_functions: The function map to use to find functions containing
122
143
// / calls and function bodies.
123
144
// / \param ns: Namespace used by goto_inlinet.
124
145
// / \param message_handler: Message handler used by goto_inlinet.
125
146
// / \param smallfunc_limit: The maximum number of instructions in functions to
126
147
// / be inlined.
127
- // / \param adjust_function: Tell goto_inlinet to adjust function.
148
+ // / \param adjust_function: Replace location in inlined function with call site .
128
149
void goto_partial_inline (
129
150
goto_functionst &goto_functions,
130
151
const namespacet &ns,
@@ -153,6 +174,9 @@ void goto_partial_inline(
153
174
if (gf_entry.first == goto_functions.entry_point ())
154
175
{
155
176
// Don't inline any function calls made from the _start function.
177
+ // This is so that the convention of __CPROVER_start
178
+ // calling __CPROVER_initialize is maintained, so these can be
179
+ // augmented / replaced by later passes.
156
180
continue ;
157
181
}
158
182
@@ -205,11 +229,12 @@ void goto_partial_inline(
205
229
goto_inline.goto_inline (inline_map, false );
206
230
}
207
231
208
- // / Inline all function calls made from a particular function
232
+ // / Transitively inline all function calls made from a particular function.
233
+ // / Caller is responsible for calling update(), compute_loop_numbers(), etc.
209
234
// / \param goto_model: Source of the symbol table and function map to use.
210
235
// / \param function: The function whose calls to inline.
211
236
// / \param message_handler: Message handler used by goto_inlinet.
212
- // / \param adjust_function: Tell goto_inlinet to adjust function.
237
+ // / \param adjust_function: Replace location in inlined function with call site .
213
238
// / \param caching: Tell goto_inlinet to cache.
214
239
void goto_function_inline (
215
240
goto_modelt &goto_model,
@@ -228,12 +253,13 @@ void goto_function_inline(
228
253
caching);
229
254
}
230
255
231
- // / Inline all function calls made from a particular function
256
+ // / Transitively inline all function calls made from a particular function.
257
+ // / Caller is responsible for calling update(), compute_loop_numbers(), etc.
232
258
// / \param goto_functions: The function map to use to find function bodies.
233
259
// / \param function: The function whose calls to inline.
234
260
// / \param ns: Namespace used by goto_inlinet.
235
261
// / \param message_handler: Message handler used by goto_inlinet.
236
- // / \param adjust_function: Tell goto_inlinet to adjust function.
262
+ // / \param adjust_function: Replace location in inlined function with call site .
237
263
// / \param caching: Tell goto_inlinet to cache.
238
264
void goto_function_inline (
239
265
goto_functionst &goto_functions,
0 commit comments