@@ -476,8 +476,7 @@ void dfcc_utilst::inline_function(const irep_idt &function_id)
476476
477477 inlining_decoratort decorated (log.get_message_handler ());
478478 namespacet ns{goto_model.symbol_table };
479- goto_function_inline (
480- goto_model.goto_functions , function_id, ns, log.get_message_handler ());
479+ goto_function_inline (goto_model.goto_functions , function_id, ns, decorated);
481480
482481 decorated.throw_on_recursive_calls (log, 0 );
483482 decorated.throw_on_no_body (log, 0 );
@@ -503,8 +502,7 @@ void dfcc_utilst::inline_function(
503502
504503 inlining_decoratort decorated (log.get_message_handler ());
505504 namespacet ns{goto_model.symbol_table };
506- goto_function_inline (
507- goto_model.goto_functions , function_id, ns, log.get_message_handler ());
505+ goto_function_inline (goto_model.goto_functions , function_id, ns, decorated);
508506 no_body.insert (
509507 decorated.get_no_body_set ().begin (), decorated.get_no_body_set ().end ());
510508 recursive_call.insert (
@@ -519,10 +517,51 @@ void dfcc_utilst::inline_function(
519517 goto_model.goto_functions .update ();
520518}
521519
520+ void dfcc_utilst::inline_program (goto_programt &program)
521+ {
522+ inlining_decoratort decorated (log.get_message_handler ());
523+ namespacet ns{goto_model.symbol_table };
524+ goto_program_inline (goto_model.goto_functions , program, ns, decorated);
525+
526+ decorated.throw_on_recursive_calls (log, 0 );
527+ decorated.throw_on_no_body (log, 0 );
528+ decorated.throw_on_missing_function (log, 0 );
529+ decorated.throw_on_not_enough_arguments (log, 0 );
530+ }
531+
532+ void dfcc_utilst::inline_program (
533+ goto_programt &goto_program,
534+ std::set<irep_idt> &no_body,
535+ std::set<irep_idt> &recursive_call,
536+ std::set<irep_idt> &missing_function,
537+ std::set<irep_idt> ¬_enough_arguments)
538+ {
539+ inlining_decoratort decorated (log.get_message_handler ());
540+ namespacet ns{goto_model.symbol_table };
541+ goto_program_inline (goto_model.goto_functions , goto_program, ns, decorated);
542+ no_body.insert (
543+ decorated.get_no_body_set ().begin (), decorated.get_no_body_set ().end ());
544+ recursive_call.insert (
545+ decorated.get_recursive_call_set ().begin (),
546+ decorated.get_recursive_call_set ().end ());
547+ missing_function.insert (
548+ decorated.get_missing_function_set ().begin (),
549+ decorated.get_missing_function_set ().end ());
550+ not_enough_arguments.insert (
551+ decorated.get_not_enough_arguments_set ().begin (),
552+ decorated.get_not_enough_arguments_set ().end ());
553+ goto_model.goto_functions .update ();
554+ }
555+
556+ bool dfcc_utilst::has_no_loops (const goto_programt &goto_program)
557+ {
558+ return is_loop_free (goto_program, ns, log);
559+ }
560+
522561bool dfcc_utilst::has_no_loops (const irep_idt &function_id)
523562{
524- auto &goto_function = goto_model. goto_functions . function_map . at (function_id);
525- return is_loop_free (goto_function .body , ns, log );
563+ return has_no_loops (
564+ goto_model. goto_functions . function_map . at (function_id) .body );
526565}
527566
528567void dfcc_utilst::set_hide (const irep_idt &function_id, bool hide)
0 commit comments