Skip to content

Commit bf8e58b

Browse files
Parse debug-level at symex_config construction
No functional change
1 parent 8e177a5 commit bf8e58b

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

src/goto-symex/goto_symex.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ struct symex_configt final
5959
bool simplify_opt;
6060
bool unwinding_assertions;
6161
bool partial_loops;
62-
std::string debug_level;
62+
mp_integer debug_level;
6363

6464
explicit symex_configt(const optionst &options);
6565
};

src/goto-symex/symex_builtin_functions.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -458,8 +458,6 @@ void goto_symext::symex_trace(
458458
{
459459
PRECONDITION(code.arguments().size() >= 2);
460460

461-
int debug_thresh = unsafe_string2int(symex_config.debug_level);
462-
463461
mp_integer debug_lvl;
464462
optionalt<mp_integer> maybe_debug =
465463
numeric_cast<mp_integer>(code.arguments()[0]);
@@ -473,7 +471,7 @@ void goto_symext::symex_trace(
473471
code.arguments()[1].op0().id() == ID_string_constant,
474472
"CBMC_trace expects string constant as second argument");
475473

476-
if(mp_integer(debug_thresh)>=debug_lvl)
474+
if(symex_config.debug_level >= debug_lvl)
477475
{
478476
std::list<exprt> vars;
479477

src/goto-symex/symex_main.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Author: Daniel Kroening, [email protected]
1818
#include <util/make_unique.h>
1919
#include <util/replace_symbol.h>
2020
#include <util/std_expr.h>
21+
#include <util/string2int.h>
2122
#include <util/symbol_table.h>
2223

2324
#include <analyses/dirty.h>
@@ -33,7 +34,7 @@ symex_configt::symex_configt(const optionst &options)
3334
simplify_opt(options.get_bool_option("simplify")),
3435
unwinding_assertions(options.get_bool_option("unwinding-assertions")),
3536
partial_loops(options.get_bool_option("partial-loops")),
36-
debug_level(options.get_option("debug-level"))
37+
debug_level(unsafe_string2int(options.get_option("debug-level")))
3738
{
3839
}
3940

0 commit comments

Comments
 (0)