@@ -247,14 +247,14 @@ void dfcct::transform_goto_model(
247247 // generate assignable_t functions from contracts
248248 for (const auto &function_id : spec_assigns_from_contract_functions)
249249 {
250- dsl_contract_handler.dfcc_spec_assigns_function_from_contract (
250+ dsl_contract_handler.create_spec_assigns_function_from_contract (
251251 function_id, spec_assigns_functions);
252252 }
253253
254254 // inline all assignable_t functions
255255 for (const auto &function_id : spec_assigns_functions)
256256 {
257- inline_and_check_loop_freeness (function_id);
257+ utils. inline_and_check_loop_freeness (function_id);
258258 }
259259
260260 // instrument all assignable_t functions
@@ -266,14 +266,14 @@ void dfcct::transform_goto_model(
266266 // generate frees_t functions from contracts
267267 for (const auto &function_id : spec_frees_from_contract_functions)
268268 {
269- dsl_contract_handler.dfcc_spec_frees_function_from_contract (
269+ dsl_contract_handler.create_spec_frees_function_from_contract (
270270 function_id, spec_frees_functions);
271271 }
272272
273273 // inline all frees_t functions
274274 for (const auto &function_id : spec_frees_functions)
275275 {
276- inline_and_check_loop_freeness (function_id);
276+ utils. inline_and_check_loop_freeness (function_id);
277277 }
278278
279279 // instrument all frees_t functions
@@ -327,7 +327,8 @@ void dfcct::transform_harness_function(const irep_idt &function_id)
327327{
328328 /*
329329 Transforming the harness function just consists in passing a NULL value
330- for the __dfcc_set parameter to each function call or function pointer call.
330+ for the assignable_set parameter to each function call or
331+ function pointer call.
331332 This will result in no DFCC set updates or checks being performed in
332333 functions called directly from the harness.
333334 */
@@ -399,7 +400,7 @@ const symbolt &dfcct::add_dfcc_param(const irep_idt &function_id)
399400 const auto &sym = utils.create_symbol (
400401 library.dfcc_type [dfcc_typet::SET_PTR],
401402 id2string (function_id),
402- " __dfcc_set " ,
403+ " __to_check " ,
403404 function_symbol.location ,
404405 function_symbol.mode ,
405406 function_symbol.module ,
@@ -413,68 +414,6 @@ const symbolt &dfcct::add_dfcc_param(const irep_idt &function_id)
413414 return sym;
414415}
415416
416- const symbolt &dfcct::add_dfcc_local (
417- const irep_idt &function_id,
418- const int contract_assigns_size_hint,
419- const bool contract_frees_append,
420- goto_programt &decl_init,
421- goto_programt &dead)
422- {
423- const auto &function_symbol = utils.get_function_symbol (function_id);
424-
425- const auto &sym = utils.create_symbol (
426- library.dfcc_type [dfcc_typet::SET],
427- id2string (function_id),
428- " __dfcc_set_local" ,
429- function_symbol.location ,
430- function_symbol.mode ,
431- function_symbol.module ,
432- false );
433-
434- const auto sym_expr = sym.symbol_expr ();
435- decl_init.add (goto_programt::make_decl (sym_expr));
436-
437- // initialise
438- auto function_sym_expr =
439- library.dfcc_fun_symbol .at (dfcc_funt::SET_CREATE).symbol_expr ();
440- code_function_callt code_function_call (function_sym_expr);
441- auto &arguments = code_function_call.arguments ();
442- arguments.emplace_back (address_of_exprt (sym_expr));
443- arguments.emplace_back (from_integer (contract_assigns_size_hint, size_type ()));
444- arguments.emplace_back (
445- (contract_frees_append ? (exprt)true_exprt () : (exprt)false_exprt ()));
446-
447- // kill
448- dead.add (goto_programt::make_dead (sym_expr));
449- return sym;
450- }
451-
452- void dfcct::inline_and_check_loop_freeness (const irep_idt &function_id)
453- {
454- auto &goto_function = goto_model.goto_functions .function_map .at (function_id);
455-
456- PRECONDITION_WITH_DIAGNOSTICS (
457- goto_function.body_available (),
458- " dfcc: function " + id2string (function_id) + " must have a body" );
459-
460- inlining_decoratort decorated (log.get_message_handler ());
461- namespacet ns{goto_model.symbol_table };
462- goto_function_inline (
463- goto_model.goto_functions , function_id, ns, log.get_message_handler ());
464-
465- PRECONDITION_WITH_DIAGNOSTICS (
466- decorated.get_recursive_function_warnings_count () == 0 ,
467- " dfcc: function " + id2string (function_id) +
468- " must not contain recursive function calls" );
469-
470- PRECONDITION_WITH_DIAGNOSTICS (
471- is_loop_free (goto_function.body , ns, log),
472- " dfcc: function " + id2string (function_id) + " must not contain loops" );
473-
474- // restore internal invariants
475- goto_model.goto_functions .update ();
476- }
477-
478417void dfcct::to_dfcc_spec_assigns_function (const irep_idt &function_id)
479418{
480419 log.debug () << " dfcc: to_dfcc_spec_assigns_function(" << function_id << " )"
@@ -488,7 +427,7 @@ void dfcct::to_dfcc_spec_assigns_function(const irep_idt &function_id)
488427
489428 // add __dfcc_set parameter
490429 auto &set_symbol = utils.add_parameter (
491- function_id, " __dfcc_set " , library.dfcc_type [dfcc_typet::SET_PTR]);
430+ function_id, " __to_populate " , library.dfcc_type [dfcc_typet::SET_PTR]);
492431
493432 // rewrite calls
494433 Forall_goto_program_instructions (ins_it, goto_function.body )
@@ -525,8 +464,8 @@ void dfcct::to_dfcc_spec_assigns_function(const irep_idt &function_id)
525464 {
526465 INVARIANT (
527466 false ,
528- " to_dfcc_spec_assigns_function: function calls must be inlined "
529- " before calling this function" );
467+ " dfcct:: to_dfcc_spec_assigns_function: function calls must be "
468+ " inlined before calling this function" );
530469 }
531470 }
532471 }
0 commit comments