@@ -247,14 +247,14 @@ void dfcct::transform_goto_model(
247
247
// generate assignable_t functions from contracts
248
248
for (const auto &function_id : spec_assigns_from_contract_functions)
249
249
{
250
- dsl_contract_handler.dfcc_spec_assigns_function_from_contract (
250
+ dsl_contract_handler.create_spec_assigns_function_from_contract (
251
251
function_id, spec_assigns_functions);
252
252
}
253
253
254
254
// inline all assignable_t functions
255
255
for (const auto &function_id : spec_assigns_functions)
256
256
{
257
- inline_and_check_loop_freeness (function_id);
257
+ utils. inline_and_check_loop_freeness (function_id);
258
258
}
259
259
260
260
// instrument all assignable_t functions
@@ -266,14 +266,14 @@ void dfcct::transform_goto_model(
266
266
// generate frees_t functions from contracts
267
267
for (const auto &function_id : spec_frees_from_contract_functions)
268
268
{
269
- dsl_contract_handler.dfcc_spec_frees_function_from_contract (
269
+ dsl_contract_handler.create_spec_frees_function_from_contract (
270
270
function_id, spec_frees_functions);
271
271
}
272
272
273
273
// inline all frees_t functions
274
274
for (const auto &function_id : spec_frees_functions)
275
275
{
276
- inline_and_check_loop_freeness (function_id);
276
+ utils. inline_and_check_loop_freeness (function_id);
277
277
}
278
278
279
279
// instrument all frees_t functions
@@ -327,7 +327,8 @@ void dfcct::transform_harness_function(const irep_idt &function_id)
327
327
{
328
328
/*
329
329
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.
331
332
This will result in no DFCC set updates or checks being performed in
332
333
functions called directly from the harness.
333
334
*/
@@ -399,7 +400,7 @@ const symbolt &dfcct::add_dfcc_param(const irep_idt &function_id)
399
400
const auto &sym = utils.create_symbol (
400
401
library.dfcc_type [dfcc_typet::SET_PTR],
401
402
id2string (function_id),
402
- " __dfcc_set " ,
403
+ " __to_check " ,
403
404
function_symbol.location ,
404
405
function_symbol.mode ,
405
406
function_symbol.module ,
@@ -413,68 +414,6 @@ const symbolt &dfcct::add_dfcc_param(const irep_idt &function_id)
413
414
return sym;
414
415
}
415
416
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
-
478
417
void dfcct::to_dfcc_spec_assigns_function (const irep_idt &function_id)
479
418
{
480
419
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)
488
427
489
428
// add __dfcc_set parameter
490
429
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]);
492
431
493
432
// rewrite calls
494
433
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)
525
464
{
526
465
INVARIANT (
527
466
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" );
530
469
}
531
470
}
532
471
}
0 commit comments