Skip to content

Commit a61ee58

Browse files
committed
Move unwindset.{h,cpp} to goto-programs
This code is not specific to goto-instrument and used more widely across the code base. Removes a now-unnecessary dependency of goto-checker on goto-instrument.
1 parent 3c915eb commit a61ee58

18 files changed

+32
-39
lines changed

src/goto-checker/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ add_library(goto-checker ${sources})
33

44
generic_includes(goto-checker)
55

6-
target_link_libraries(goto-checker goto-programs goto-symex solvers util xml goto-instrument-lib)
6+
target_link_libraries(goto-checker goto-programs goto-symex solvers util xml)

src/goto-checker/bmc_util.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ Author: Daniel Kroening, Peter Schrammel
1212
#ifndef CPROVER_GOTO_CHECKER_BMC_UTIL_H
1313
#define CPROVER_GOTO_CHECKER_BMC_UTIL_H
1414

15-
#include <goto-instrument/unwindset.h>
15+
#include <goto-programs/unwindset.h>
16+
1617
#include <goto-symex/build_goto_trace.h>
1718

1819
#include "incremental_goto_checker.h"

src/goto-checker/module_dependencies.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
assembler
22
cbmc # symex_bmc will be moved next
33
goto-checker
4-
goto-instrument
54
goto-programs
65
goto-symex
76
langapi

src/goto-checker/multi_path_symex_only_checker.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,11 @@ Author: Daniel Kroening, Peter Schrammel
1212
#ifndef CPROVER_GOTO_CHECKER_MULTI_PATH_SYMEX_ONLY_CHECKER_H
1313
#define CPROVER_GOTO_CHECKER_MULTI_PATH_SYMEX_ONLY_CHECKER_H
1414

15-
#include "incremental_goto_checker.h"
15+
#include <goto-programs/unwindset.h>
1616

1717
#include <goto-symex/path_storage.h>
1818

19-
#include <goto-instrument/unwindset.h>
20-
19+
#include "incremental_goto_checker.h"
2120
#include "symex_bmc.h"
2221

2322
class multi_path_symex_only_checkert : public incremental_goto_checkert

src/goto-checker/single_loop_incremental_symex_checker.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ Author: Daniel Kroening, Peter Schrammel
1414
#ifndef CPROVER_GOTO_CHECKER_SINGLE_LOOP_INCREMENTAL_SYMEX_CHECKER_H
1515
#define CPROVER_GOTO_CHECKER_SINGLE_LOOP_INCREMENTAL_SYMEX_CHECKER_H
1616

17-
#include <goto-symex/path_storage.h>
17+
#include <goto-programs/unwindset.h>
1818

19-
#include <goto-instrument/unwindset.h>
19+
#include <goto-symex/path_storage.h>
2020

2121
#include "goto_symex_property_decider.h"
2222
#include "goto_trace_provider.h"

src/goto-checker/single_path_symex_only_checker.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ Author: Daniel Kroening, Peter Schrammel
1212
#ifndef CPROVER_GOTO_CHECKER_SINGLE_PATH_SYMEX_ONLY_CHECKER_H
1313
#define CPROVER_GOTO_CHECKER_SINGLE_PATH_SYMEX_ONLY_CHECKER_H
1414

15-
#include <goto-instrument/unwindset.h>
15+
#include <goto-programs/unwindset.h>
16+
1617
#include <goto-symex/path_storage.h>
1718

1819
#include "incremental_goto_checker.h"

src/goto-checker/symex_bmc.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ Author: Daniel Kroening, [email protected]
1111

1212
#include "symex_bmc.h"
1313

14-
#include <limits>
15-
1614
#include <util/simplify_expr.h>
1715
#include <util/source_location.h>
1816

19-
#include <goto-instrument/unwindset.h>
17+
#include <goto-programs/unwindset.h>
18+
19+
#include <limits>
2020

2121
symex_bmct::symex_bmct(
2222
message_handlert &mh,

src/goto-checker/symex_bmc_incremental_one_loop.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ Author: Peter Schrammel, Daniel Kroening, [email protected]
66
77
\*******************************************************************/
88

9-
#include <limits>
10-
119
#include "symex_bmc_incremental_one_loop.h"
1210

1311
#include <util/structured_data.h>
1412

15-
#include <goto-instrument/unwindset.h>
13+
#include <goto-programs/unwindset.h>
14+
15+
#include <limits>
1616

1717
symex_bmc_incremental_one_loopt::symex_bmc_incremental_one_loopt(
1818
message_handlert &message_handler,

src/goto-instrument/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ SRC = accelerate/accelerate.cpp \
9999
undefined_functions.cpp \
100100
uninitialized.cpp \
101101
unwind.cpp \
102-
unwindset.cpp \
103102
value_set_fi_fp_removal.cpp \
104103
wmm/abstract_event.cpp \
105104
wmm/cycle_collection.cpp \

src/goto-instrument/contracts/contracts.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ Date: February 2016
2727
#include <goto-programs/goto_inline.h>
2828
#include <goto-programs/goto_program.h>
2929
#include <goto-programs/remove_skip.h>
30+
#include <goto-programs/unwindset.h>
3031

3132
#include <analyses/local_may_alias.h>
3233
#include <ansi-c/c_expr.h>
3334
#include <goto-instrument/havoc_utils.h>
3435
#include <goto-instrument/nondet_static.h>
3536
#include <goto-instrument/unwind.h>
36-
#include <goto-instrument/unwindset.h>
3737
#include <langapi/language_util.h>
3838

3939
#include "cfg_info.h"

src/goto-instrument/contracts/dynamic-frames/dfcc_instrument.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ Author: Remi Delmas, [email protected]
2020

2121
#include <goto-programs/goto_model.h>
2222
#include <goto-programs/remove_skip.h>
23+
#include <goto-programs/unwindset.h>
2324

2425
#include <ansi-c/c_expr.h>
2526
#include <ansi-c/c_object_factory_parameters.h>
2627
#include <goto-instrument/contracts/utils.h>
2728
#include <goto-instrument/generate_function_bodies.h>
2829
#include <goto-instrument/unwind.h>
29-
#include <goto-instrument/unwindset.h>
3030
#include <langapi/language_util.h>
3131

3232
#include "dfcc_cfg_info.h"

src/goto-instrument/contracts/dynamic-frames/dfcc_library.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ Author: Remi Delmas, [email protected]
2020

2121
#include <goto-programs/goto_function.h>
2222
#include <goto-programs/goto_model.h>
23+
#include <goto-programs/unwindset.h>
2324

2425
#include <ansi-c/c_expr.h>
2526
#include <ansi-c/c_object_factory_parameters.h>
2627
#include <ansi-c/cprover_library.h>
2728
#include <ansi-c/goto-conversion/goto_convert_functions.h>
2829
#include <goto-instrument/generate_function_bodies.h>
2930
#include <goto-instrument/unwind.h>
30-
#include <goto-instrument/unwindset.h>
3131
#include <linking/static_lifetime_init.h>
3232

3333
#include "dfcc_utils.h"

src/goto-instrument/goto_instrument_parse_options.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Author: Daniel Kroening, [email protected]
2424
#include <goto-programs/restrict_function_pointers.h>
2525
#include <goto-programs/show_goto_functions.h>
2626
#include <goto-programs/show_properties.h>
27+
#include <goto-programs/unwindset.h>
2728

2829
#include <ansi-c/ansi_c_language.h>
2930
#include <ansi-c/goto-conversion/goto_check_c.h>
@@ -39,7 +40,6 @@ Author: Daniel Kroening, [email protected]
3940
#include "reachability_slicer.h"
4041
#include "replace_calls.h"
4142
#include "uninitialized.h"
42-
#include "unwindset.h"
4343

4444
#include "contracts/contracts.h"
4545
#include "contracts/contracts_wrangler.h"

src/goto-instrument/unwind.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ Author: Daniel Kroening, [email protected]
2020
#include <util/std_expr.h>
2121

2222
#include <goto-programs/goto_functions.h>
23-
24-
#include "unwindset.h"
23+
#include <goto-programs/unwindset.h>
2524

2625
void goto_unwindt::copy_segment(
2726
const goto_programt::const_targett start,

src/goto-programs/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ SRC = adjust_float_expressions.cpp \
5656
string_abstraction.cpp \
5757
structured_trace_util.cpp \
5858
system_library_symbols.cpp \
59+
unwindset.cpp \
5960
validate_code.cpp \
6061
validate_goto_model.cpp \
6162
vcd_goto_trace.cpp \

src/goto-instrument/unwindset.cpp renamed to src/goto-programs/unwindset.cpp

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

18-
#include <goto-programs/abstract_goto_model.h>
18+
#include "abstract_goto_model.h"
1919

2020
#include <algorithm>
2121
#include <fstream>
@@ -216,7 +216,7 @@ void unwindsett::parse_unwindset_file(
216216
std::ifstream file(widen_if_needed(file_name));
217217

218218
if(!file)
219-
throw "cannot open file "+file_name;
219+
throw "cannot open file " + file_name;
220220

221221
std::stringstream buffer;
222222
buffer << file.rdbuf();
File renamed without changes.

unit/path_strategies.cpp

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,31 +6,25 @@ Author: Kareem Khazem <[email protected]>, 2018
66
77
\*******************************************************************/
88

9-
#include <testing-utils/use_catch.h>
9+
#include <util/cmdline.h>
10+
#include <util/config.h>
11+
#include <util/tempfile.h>
1012

11-
#include <path_strategies.h>
12-
13-
#include <fstream>
14-
#include <functional>
15-
#include <string>
13+
#include <goto-programs/unwindset.h>
1614

1715
#include <ansi-c/ansi_c_language.h>
18-
1916
#include <cbmc/cbmc_parse_options.h>
20-
2117
#include <goto-checker/bmc_util.h>
2218
#include <goto-checker/goto_symex_property_decider.h>
2319
#include <goto-checker/symex_bmc.h>
24-
2520
#include <goto-symex/path_storage.h>
26-
27-
#include <goto-instrument/unwindset.h>
28-
2921
#include <langapi/mode.h>
22+
#include <testing-utils/use_catch.h>
3023

31-
#include <util/cmdline.h>
32-
#include <util/config.h>
33-
#include <util/tempfile.h>
24+
#include <fstream>
25+
#include <functional>
26+
#include <path_strategies.h>
27+
#include <string>
3428

3529
// The actual test suite.
3630
//

0 commit comments

Comments
 (0)