Skip to content

Commit 0ddc640

Browse files
committed
Added the command line argument support for while(true) wrapping of the entry point to the goto-instrument tool, and added an associated help text to the other tools.
1 parent 5c211c7 commit 0ddc640

File tree

5 files changed

+9
-0
lines changed

5 files changed

+9
-0
lines changed

src/cbmc/cbmc_parse_options.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1023,6 +1023,7 @@ void cbmc_parse_optionst::help()
10231023
" --round-to-minus-inf rounding towards minus infinity\n"
10241024
" --round-to-zero rounding towards zero\n"
10251025
" --function name set main function name\n"
1026+
HELP_WRAP_ENTRY_POINT_IN_WHILE_TRUE
10261027
"\n"
10271028
"Program representations:\n"
10281029
" --show-parse-tree show parse tree\n"

src/goto-analyzer/goto_analyzer_parse_options.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -757,6 +757,7 @@ void goto_analyzer_parse_optionst::help()
757757
" --gcc use GCC as preprocessor\n"
758758
#endif
759759
" --no-library disable built-in abstract C library\n"
760+
HELP_WRAP_ENTRY_POINT_IN_WHILE_TRUE
760761
"\n"
761762
"Java Bytecode frontend options:\n"
762763
" --classpath dir/jar set the classpath\n"

src/goto-instrument/goto_instrument_parse_options.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1554,6 +1554,7 @@ void goto_instrument_parse_optionst::help()
15541554
" --log <file> log in json format which code segments were inlined, use with --function-inline\n" // NOLINT(*)
15551555
" --remove-function-pointers replace function pointers by case statement over function calls\n" // NOLINT(*)
15561556
HELP_REMOVE_CONST_FUNCTION_POINTERS
1557+
HELP_WRAP_ENTRY_POINT_IN_WHILE_TRUE
15571558
" --add-library add models of C library functions\n"
15581559
" --model-argc-argv <n> model up to <n> command line arguments\n"
15591560
// NOLINTNEXTLINE(whitespace/line_length)

src/goto-instrument/goto_instrument_parse_options.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Author: Daniel Kroening, [email protected]
1616
#include <util/parse_options.h>
1717

1818
#include <langapi/language_ui.h>
19+
#include <langapi/wrap_entry_point.h>
1920
#include <goto-programs/goto_functions.h>
2021
#include <goto-programs/show_goto_functions.h>
2122
#include <goto-programs/remove_const_function_pointers.h>
@@ -78,6 +79,7 @@ Author: Daniel Kroening, [email protected]
7879
"(show-threaded)(list-calls-args)(print-path-lengths)" \
7980
"(undefined-function-is-assume-false)" \
8081
"(remove-function-body):" \
82+
WRAP_ENTRY_POINT_IN_WHILE_TRUE \
8183
"(remove-calls-nobody)"
8284

8385
class goto_instrument_parse_optionst:

src/langapi/wrap_entry_point.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ Date: August 2017
1616
/// Command line option (to be shared by the different tools)
1717
#define WRAP_ENTRY_POINT_IN_WHILE_TRUE "(wrap-entry-point-in-while)"
1818

19+
/// Command line help text
20+
#define HELP_WRAP_ENTRY_POINT_IN_WHILE_TRUE \
21+
" --wrap-entry-point-in-while wrap the designated entry point function in a while(true) statement\n" // NOLINT(*)
22+
1923
code_whilet wrap_entry_point_in_while(
2024
code_function_callt &call_main);
2125

0 commit comments

Comments
 (0)