|
22 | 22 | #include <ansi-c/string_constant.h>
|
23 | 23 |
|
24 | 24 | #include <goto-programs/goto_functions.h>
|
25 |
| -#include <langapi/wrap_entry_point.h> |
26 | 25 | #include <linking/static_lifetime_init.h>
|
27 | 26 |
|
28 | 27 | #include "ansi_c_entry_point.h"
|
29 | 28 | #include "ansi_c_language.h"
|
30 | 29 | #include "c_nondet_symbol_factory.h"
|
31 | 30 |
|
| 31 | +// Build and return a while(true) statement nesting the function call |
| 32 | +// passed as a parameter. |
| 33 | +code_whilet wrap_entry_point_in_while(code_function_callt &call_main) |
| 34 | +{ |
| 35 | + exprt true_expr; |
| 36 | + code_whilet while_expr; |
| 37 | + true_expr.make_true(); |
| 38 | + while_expr.cond()=true_expr; |
| 39 | + while_expr.body()=call_main; |
| 40 | + |
| 41 | + return while_expr; |
| 42 | +} |
| 43 | + |
32 | 44 | exprt::operandst build_function_environment(
|
33 | 45 | const code_typet::parameterst ¶meters,
|
34 | 46 | code_blockt &init_code,
|
@@ -123,8 +135,7 @@ void record_function_outputs(
|
123 | 135 | bool ansi_c_entry_point(
|
124 | 136 | symbol_tablet &symbol_table,
|
125 | 137 | const std::string &standard_main,
|
126 |
| - message_handlert &message_handler, |
127 |
| - bool wrap_entry_point) |
| 138 | + message_handlert &message_handler) |
128 | 139 | {
|
129 | 140 | // check if entry point is already there
|
130 | 141 | if(symbol_table.symbols.find(goto_functionst::entry_point())!=
|
@@ -447,7 +458,7 @@ bool ansi_c_entry_point(
|
447 | 458 | message_handler);
|
448 | 459 | }
|
449 | 460 |
|
450 |
| - if(wrap_entry_point) |
| 461 | + if(config.ansi_c.wrap_entry_point_in_while) |
451 | 462 | {
|
452 | 463 | code_whilet wrapped_main=wrap_entry_point_in_while(call_main);
|
453 | 464 | init_code.move_to_operands(wrapped_main);
|
|
0 commit comments