@@ -16,6 +16,13 @@ Author: Daniel Kroening, kroening@kroening.com
1616#include " goto_inline_class.h"
1717#include " goto_model.h"
1818
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.
1926void goto_inline (
2027 goto_modelt &goto_model,
2128 message_handlert &message_handler,
@@ -29,6 +36,14 @@ void goto_inline(
2936 adjust_function);
3037}
3138
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.
3247void goto_inline (
3348 goto_functionst &goto_functions,
3449 const namespacet &ns,
@@ -96,11 +111,14 @@ void goto_inline(
96111
97112// / Inline all function calls to functions either marked as "inlined" or
98113// / 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.
99117// / \param goto_model: Source of the symbol table and function map to use.
100118// / \param message_handler: Message handler used by goto_inlinet.
101119// / \param smallfunc_limit: The maximum number of instructions in functions to
102120// / be inlined.
103- // / \param adjust_function: Tell goto_inlinet to adjust function.
121+ // / \param adjust_function: Replace location in inlined function with call site .
104122void goto_partial_inline (
105123 goto_modelt &goto_model,
106124 message_handlert &message_handler,
@@ -118,13 +136,16 @@ void goto_partial_inline(
118136
119137// / Inline all function calls to functions either marked as "inlined" or
120138// / 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.
121142// / \param goto_functions: The function map to use to find functions containing
122143// / calls and function bodies.
123144// / \param ns: Namespace used by goto_inlinet.
124145// / \param message_handler: Message handler used by goto_inlinet.
125146// / \param smallfunc_limit: The maximum number of instructions in functions to
126147// / be inlined.
127- // / \param adjust_function: Tell goto_inlinet to adjust function.
148+ // / \param adjust_function: Replace location in inlined function with call site .
128149void goto_partial_inline (
129150 goto_functionst &goto_functions,
130151 const namespacet &ns,
@@ -153,6 +174,9 @@ void goto_partial_inline(
153174 if (gf_entry.first == goto_functions.entry_point ())
154175 {
155176 // 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.
156180 continue ;
157181 }
158182
@@ -205,11 +229,12 @@ void goto_partial_inline(
205229 goto_inline.goto_inline (inline_map, false );
206230}
207231
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.
209234// / \param goto_model: Source of the symbol table and function map to use.
210235// / \param function: The function whose calls to inline.
211236// / \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 .
213238// / \param caching: Tell goto_inlinet to cache.
214239void goto_function_inline (
215240 goto_modelt &goto_model,
@@ -228,12 +253,13 @@ void goto_function_inline(
228253 caching);
229254}
230255
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.
232258// / \param goto_functions: The function map to use to find function bodies.
233259// / \param function: The function whose calls to inline.
234260// / \param ns: Namespace used by goto_inlinet.
235261// / \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 .
237263// / \param caching: Tell goto_inlinet to cache.
238264void goto_function_inline (
239265 goto_functionst &goto_functions,
0 commit comments