@@ -22,7 +22,8 @@ Author: Daniel Kroening, kroening@kroening.com
2222exprt::operandst build_function_environment (
2323 const code_typet::parameterst ¶meters,
2424 code_blockt &init_code,
25- symbol_tablet &symbol_table)
25+ symbol_tablet &symbol_table,
26+ const c_object_factory_parameterst &object_factory_parameters)
2627{
2728 exprt::operandst main_arguments;
2829 main_arguments.resize (parameters.size ());
@@ -35,14 +36,14 @@ exprt::operandst build_function_environment(
3536 const irep_idt base_name=p.get_base_name ().empty ()?
3637 (" argument#" +std::to_string (param_number)):p.get_base_name ();
3738
38- main_arguments[param_number]=
39- c_nondet_symbol_factory (
40- init_code ,
41- symbol_table ,
42- base_name ,
43- p. type (),
44- p. source_location () ,
45- true );
39+ main_arguments[param_number] = c_nondet_symbol_factory (
40+ init_code,
41+ symbol_table ,
42+ base_name ,
43+ p. type () ,
44+ p. source_location (),
45+ true ,
46+ object_factory_parameters );
4647 }
4748
4849 return main_arguments;
@@ -111,7 +112,8 @@ void record_function_outputs(
111112
112113bool ansi_c_entry_point (
113114 symbol_tablet &symbol_table,
114- message_handlert &message_handler)
115+ message_handlert &message_handler,
116+ const c_object_factory_parameterst &object_factory_parameters)
115117{
116118 // check if entry point is already there
117119 if (symbol_table.symbols .find (goto_functionst::entry_point ())!=
@@ -179,21 +181,24 @@ bool ansi_c_entry_point(
179181
180182 static_lifetime_init (symbol_table, symbol.location );
181183
182- return generate_ansi_c_start_function (symbol, symbol_table, message_handler);
184+ return generate_ansi_c_start_function (
185+ symbol, symbol_table, message_handler, object_factory_parameters);
183186}
184187
185-
186188// / Generate a _start function for a specific function
187189// / \param symbol: The symbol for the function that should be
188190// / used as the entry point
189191// / \param symbol_table: The symbol table for the program. The new _start
190192// / function symbol will be added to this table
191193// / \param message_handler: The message handler
194+ // / \param object_factory_parameters configuration parameters for the object
195+ // / factory
192196// / \return Returns false if the _start method was generated correctly
193197bool generate_ansi_c_start_function (
194198 const symbolt &symbol,
195199 symbol_tablet &symbol_table,
196- message_handlert &message_handler)
200+ message_handlert &message_handler,
201+ const c_object_factory_parameterst &object_factory_parameters)
197202{
198203 PRECONDITION (!symbol.value .is_nil ());
199204 code_blockt init_code;
@@ -423,11 +428,8 @@ bool generate_ansi_c_start_function(
423428 else
424429 {
425430 // produce nondet arguments
426- call_main.arguments ()=
427- build_function_environment (
428- parameters,
429- init_code,
430- symbol_table);
431+ call_main.arguments () = build_function_environment (
432+ parameters, init_code, symbol_table, object_factory_parameters);
431433 }
432434
433435 init_code.add (std::move (call_main));
0 commit comments