@@ -22,13 +22,25 @@ Author: Daniel Kroening, kroening@kroening.com
2222#include < ansi-c/string_constant.h>
2323
2424#include < goto-programs/goto_functions.h>
25- #include < langapi/wrap_entry_point.h>
2625#include < linking/static_lifetime_init.h>
2726
2827#include " ansi_c_entry_point.h"
2928#include " ansi_c_language.h"
3029#include " c_nondet_symbol_factory.h"
3130
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+
3244exprt::operandst build_function_environment (
3345 const code_typet::parameterst ¶meters,
3446 code_blockt &init_code,
@@ -123,8 +135,7 @@ void record_function_outputs(
123135bool ansi_c_entry_point (
124136 symbol_tablet &symbol_table,
125137 const std::string &standard_main,
126- message_handlert &message_handler,
127- bool wrap_entry_point)
138+ message_handlert &message_handler)
128139{
129140 // check if entry point is already there
130141 if (symbol_table.symbols .find (goto_functionst::entry_point ())!=
@@ -447,7 +458,7 @@ bool ansi_c_entry_point(
447458 message_handler);
448459 }
449460
450- if (wrap_entry_point )
461+ if (config. ansi_c . wrap_entry_point_in_while )
451462 {
452463 code_whilet wrapped_main=wrap_entry_point_in_while (call_main);
453464 init_code.move_to_operands (wrapped_main);
0 commit comments