@@ -578,6 +578,19 @@ int goto_instrument_parse_optionst::doit()
578578 return 0 ;
579579 }
580580
581+ if (cmdline.isset (" print-internal-representation" ))
582+ {
583+ for (auto const &pair : goto_functions.function_map )
584+ for (auto const &ins : pair.second .body .instructions )
585+ {
586+ if (ins.code .is_not_nil ())
587+ status () << ins.code .pretty () << eom;
588+ if (ins.guard .is_not_nil ())
589+ status () << " [guard] " << ins.guard .pretty () << eom;
590+ }
591+ return 0 ;
592+ }
593+
581594 if (cmdline.isset (" show-goto-functions" ))
582595 {
583596 namespacet ns (symbol_table);
@@ -770,6 +783,7 @@ int goto_instrument_parse_optionst::doit()
770783 error () << " Out of memory" << eom;
771784 return 11 ;
772785 }
786+ // NOLINTNEXTLINE(readability/fn_size)
773787}
774788
775789void goto_instrument_parse_optionst::do_indirect_call_and_rtti_removal (
@@ -1451,6 +1465,8 @@ void goto_instrument_parse_optionst::help()
14511465 " --show-symbol-table show symbol table\n "
14521466 " --list-symbols list symbols with type information\n "
14531467 HELP_SHOW_GOTO_FUNCTIONS
1468+ " --print-internal-representation\n " // NOLINTNEXTLINE(*)
1469+ " show verbose internal representation of the program\n "
14541470 " --list-undefined-functions list functions without body\n "
14551471 " --show-struct-alignment show struct members that might be concurrently accessed\n " // NOLINT(*)
14561472 " --show-natural-loops show natural loop heads\n "
@@ -1478,7 +1494,8 @@ void goto_instrument_parse_optionst::help()
14781494 " --nondet-static add nondeterministic initialization of variables with static lifetime\n " // NOLINT(*)
14791495 " --check-invariant function instruments invariant checking function\n "
14801496 " --remove-pointers converts pointer arithmetic to base+offset expressions\n " // NOLINT(*)
1481- " --undefined-function-is-assume-false\n "
1497+ // NOLINTNEXTLINE(whitespace/line_length)
1498+ " --undefined-function-is-assume-false\n " // NOLINTNEXTLINE(whitespace/line_length)
14821499 " convert each call to an undefined function to assume(false)\n "
14831500 " \n "
14841501 " Loop transformations:\n "
0 commit comments