Skip to content

Commit 3d13fa3

Browse files
kroeningtautschnig
authored andcommitted
move goto_check_ct to ansi-c/
The checks done in goto_check_ct are specific to C/C++, and thus belong into the ansi-c/ directory. This also moves goto_checkt to goto-programs/, which right now is merely a wrapper around goto_check_ct.
1 parent dae6c09 commit 3d13fa3

17 files changed

+45
-56
lines changed

jbmc/src/janalyzer/janalyzer_parse_options.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ Author: Daniel Kroening, [email protected]
2727

2828
#include <analyses/constant_propagator.h>
2929
#include <analyses/dependence_graph.h>
30-
#include <analyses/goto_check.h>
3130
#include <analyses/interval_domain.h>
3231
#include <analyses/local_may_alias.h>
3332

@@ -703,8 +702,8 @@ void janalyzer_parse_optionst::process_goto_function(
703702

704703
remove_returns(function, function_is_stub);
705704

706-
// add generic checks
707-
goto_check(
705+
// add Java-specific checks
706+
goto_check_java(
708707
function.get_function_id(),
709708
function.get_goto_function(),
710709
ns,

src/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ $(patsubst %, %.dir, $(filter-out big-int util, $(DIRS))): util.dir
5959
.PHONY: languages
6060
.PHONY: clean
6161

62+
ansi-c.dir: analyses.dir
63+
6264
cpp.dir: ansi-c.dir linking.dir
6365

6466
crangler.dir: util.dir json.dir

src/analyses/Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ SRC = ai.cpp \
1212
escape_analysis.cpp \
1313
flow_insensitive_analysis.cpp \
1414
global_may_alias.cpp \
15-
goto_check.cpp \
16-
goto_check_c.cpp \
1715
goto_rw.cpp \
1816
guard_bdd.cpp \
1917
guard_expr.cpp \

src/ansi-c/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,4 +127,4 @@ set_source_files_properties(
127127

128128
generic_includes(ansi-c)
129129

130-
target_link_libraries(ansi-c util linking goto-programs assembler)
130+
target_link_libraries(ansi-c analyses util linking goto-programs assembler)

src/ansi-c/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ SRC = anonymous_member.cpp \
3131
expr2c.cpp \
3232
gcc_types.cpp \
3333
gcc_version.cpp \
34+
goto_check_c.cpp \
3435
literals/convert_character_literal.cpp \
3536
literals/convert_float_literal.cpp \
3637
literals/convert_integer_literal.cpp \

src/analyses/goto_check_c.cpp renamed to src/ansi-c/goto_check_c.cpp

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

1212
#include "goto_check_c.h"
1313

14-
#include <algorithm>
15-
#include <optional>
16-
1714
#include <util/arith_tools.h>
1815
#include <util/array_name.h>
1916
#include <util/bitvector_expr.h>
@@ -37,13 +34,15 @@ Author: Daniel Kroening, [email protected]
3734
#include <util/std_code.h>
3835
#include <util/std_expr.h>
3936

40-
#include <langapi/language.h>
41-
#include <langapi/mode.h>
42-
4337
#include <goto-programs/goto_model.h>
4438
#include <goto-programs/remove_skip.h>
4539

46-
#include "local_bitvector_analysis.h"
40+
#include <analyses/local_bitvector_analysis.h>
41+
#include <langapi/language.h>
42+
#include <langapi/mode.h>
43+
44+
#include <algorithm>
45+
#include <optional>
4746

4847
class goto_check_ct
4948
{

src/analyses/goto_check_c.h renamed to src/ansi-c/goto_check_c.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ Author: Daniel Kroening, [email protected]
99
/// \file
1010
/// Program Transformation
1111

12-
#ifndef CPROVER_ANALYSES_GOTO_CHECK_C_H
13-
#define CPROVER_ANALYSES_GOTO_CHECK_C_H
12+
#ifndef CPROVER_ANSI_C_GOTO_CHECK_C_H
13+
#define CPROVER_ANSI_C_GOTO_CHECK_C_H
1414

1515
#include <goto-programs/goto_functions.h>
1616

src/ansi-c/module_dependencies.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
analyses
12
ansi-c
23
goto-programs
34
langapi # should go away

src/cbmc/cbmc_parse_options.h

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,29 +12,23 @@ Author: Daniel Kroening, [email protected]
1212
#ifndef CPROVER_CBMC_CBMC_PARSE_OPTIONS_H
1313
#define CPROVER_CBMC_CBMC_PARSE_OPTIONS_H
1414

15-
#include <ansi-c/ansi_c_language.h>
16-
1715
#include <util/parse_options.h>
1816
#include <util/timestamper.h>
1917
#include <util/ui_message.h>
2018
#include <util/validation_interface.h>
2119

22-
#include <langapi/language.h>
23-
24-
#include <analyses/goto_check_c.h>
25-
26-
#include <goto-checker/bmc_util.h>
27-
2820
#include <goto-programs/goto_model.h>
2921
#include <goto-programs/goto_trace.h>
3022

31-
#include <solvers/strings/string_refinement.h>
32-
23+
#include <ansi-c/ansi_c_language.h>
24+
#include <ansi-c/goto_check_c.h>
25+
#include <goto-checker/bmc_util.h>
26+
#include <goto-instrument/cover.h>
3327
#include <json/json_interface.h>
28+
#include <langapi/language.h>
29+
#include <solvers/strings/string_refinement.h>
3430
#include <xmllang/xml_interface.h>
3531

36-
#include <goto-instrument/cover.h>
37-
3832
class optionst;
3933

4034
// clang-format off

src/goto-analyzer/goto_analyzer_parse_options.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,13 @@ Author: Daniel Kroening, [email protected]
9494
#include <util/ui_message.h>
9595
#include <util/validation_interface.h>
9696

97-
#include <langapi/language.h>
98-
9997
#include <goto-programs/goto_model.h>
10098
#include <goto-programs/show_goto_functions.h>
10199
#include <goto-programs/show_properties.h>
102100

103-
#include <analyses/goto_check_c.h>
104101
#include <analyses/variable-sensitivity/variable_sensitivity_domain.h>
102+
#include <ansi-c/goto_check_c.h>
103+
#include <langapi/language.h>
105104

106105
class optionst;
107106

src/goto-diff/goto_diff_parse_options.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,14 @@ Author: Peter Schrammel
1212
#ifndef CPROVER_GOTO_DIFF_GOTO_DIFF_PARSE_OPTIONS_H
1313
#define CPROVER_GOTO_DIFF_GOTO_DIFF_PARSE_OPTIONS_H
1414

15-
#include <analyses/goto_check_c.h>
16-
17-
#include <util/ui_message.h>
1815
#include <util/parse_options.h>
1916
#include <util/timestamper.h>
17+
#include <util/ui_message.h>
2018

2119
#include <goto-programs/show_goto_functions.h>
2220
#include <goto-programs/show_properties.h>
2321

22+
#include <ansi-c/goto_check_c.h>
2423
#include <goto-instrument/cover.h>
2524

2625
class goto_modelt;

src/goto-instrument/goto_instrument_parse_options.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Author: Daniel Kroening, [email protected]
2828

2929
#include <goto-programs/class_hierarchy.h>
3030
#include <goto-programs/ensure_one_backedge_per_target.h>
31+
#include <goto-programs/goto_check.h>
3132
#include <goto-programs/goto_inline.h>
3233
#include <goto-programs/interpreter.h>
3334
#include <goto-programs/label_function_pointer_call_sites.h>
@@ -50,10 +51,6 @@ Author: Daniel Kroening, [email protected]
5051
#include <goto-programs/string_abstraction.h>
5152
#include <goto-programs/write_goto_binary.h>
5253

53-
#include <pointer-analysis/add_failed_symbols.h>
54-
#include <pointer-analysis/show_value_sets.h>
55-
#include <pointer-analysis/value_set_analysis.h>
56-
5754
#include <analyses/call_graph.h>
5855
#include <analyses/constant_propagator.h>
5956
#include <analyses/custom_bitvector_analysis.h>
@@ -69,16 +66,15 @@ Author: Daniel Kroening, [email protected]
6966
#include <analyses/natural_loops.h>
7067
#include <analyses/reaching_definitions.h>
7168
#include <analyses/sese_regions.h>
72-
7369
#include <ansi-c/ansi_c_language.h>
7470
#include <ansi-c/c_object_factory_parameters.h>
7571
#include <ansi-c/cprover_library.h>
76-
7772
#include <assembler/remove_asm.h>
78-
7973
#include <cpp/cprover_library.h>
74+
#include <pointer-analysis/add_failed_symbols.h>
75+
#include <pointer-analysis/show_value_sets.h>
76+
#include <pointer-analysis/value_set_analysis.h>
8077

81-
#include "accelerate/accelerate.h"
8278
#include "alignment_checks.h"
8379
#include "branch.h"
8480
#include "call_sequences.h"
@@ -109,6 +105,8 @@ Author: Daniel Kroening, [email protected]
109105
#include "unwind.h"
110106
#include "value_set_fi_fp_removal.h"
111107

108+
#include "accelerate/accelerate.h"
109+
112110
/// invoke main modules
113111
int goto_instrument_parse_optionst::doit()
114112
{

src/goto-instrument/goto_instrument_parse_options.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ Author: Daniel Kroening, [email protected]
1212
#ifndef CPROVER_GOTO_INSTRUMENT_GOTO_INSTRUMENT_PARSE_OPTIONS_H
1313
#define CPROVER_GOTO_INSTRUMENT_GOTO_INSTRUMENT_PARSE_OPTIONS_H
1414

15-
#include <ansi-c/ansi_c_language.h>
16-
1715
#include <util/config.h>
1816
#include <util/parse_options.h>
1917
#include <util/timestamper.h>
@@ -27,13 +25,11 @@ Author: Daniel Kroening, [email protected]
2725
#include <goto-programs/show_goto_functions.h>
2826
#include <goto-programs/show_properties.h>
2927

30-
#include <analyses/goto_check.h>
31-
#include <analyses/goto_check_c.h>
32-
28+
#include <ansi-c/ansi_c_language.h>
29+
#include <ansi-c/goto_check_c.h>
3330
#include <pointer-analysis/goto_program_dereference.h>
3431

3532
#include "aggressive_slicer.h"
36-
#include "contracts/contracts.h"
3733
#include "count_eloc.h"
3834
#include "document_properties.h"
3935
#include "dump_c.h"
@@ -43,6 +39,8 @@ Author: Daniel Kroening, [email protected]
4339
#include "replace_calls.h"
4440
#include "uninitialized.h"
4541
#include "unwindset.h"
42+
43+
#include "contracts/contracts.h"
4644
#include "wmm/weak_memory.h"
4745

4846
// clang-format off

src/goto-programs/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ SRC = allocate_objects.cpp \
1010
ensure_one_backedge_per_target.cpp \
1111
format_strings.cpp \
1212
goto_asm.cpp \
13+
goto_check.cpp \
1314
goto_clean_expr.cpp \
1415
goto_convert.cpp \
1516
goto_convert_exceptions.cpp \

src/analyses/goto_check.cpp renamed to src/goto-programs/goto_check.cpp

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

1212
#include "goto_check.h"
1313

14-
#include "goto_check_c.h"
15-
1614
#include <util/symbol.h>
1715

16+
#include <ansi-c/goto_check_c.h>
17+
1818
void goto_check(
1919
const irep_idt &function_identifier,
2020
goto_functionst::goto_functiont &goto_function,

src/analyses/goto_check.h renamed to src/goto-programs/goto_check.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ Author: Daniel Kroening, [email protected]
99
/// \file
1010
/// Checks for Errors in C and Java Programs
1111

12-
#ifndef CPROVER_ANALYSES_GOTO_CHECK_H
13-
#define CPROVER_ANALYSES_GOTO_CHECK_H
12+
#ifndef CPROVER_GOTO_PROGRAMS_GOTO_CHECK_H
13+
#define CPROVER_GOTO_PROGRAMS_GOTO_CHECK_H
1414

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

1717
class goto_modelt;
1818
class namespacet;
@@ -34,4 +34,4 @@ void goto_check(
3434

3535
void goto_check(const optionst &, goto_modelt &, message_handlert &);
3636

37-
#endif // CPROVER_ANALYSES_GOTO_CHECK_H
37+
#endif // CPROVER_GOTO_PROGRAMS_GOTO_CHECK_H

src/goto-programs/process_goto_program.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ Author: Martin Brain, [email protected]
1111

1212
#include "process_goto_program.h"
1313

14-
#include <analyses/goto_check.h>
14+
#include <util/message.h>
15+
#include <util/options.h>
1516

1617
#include <goto-programs/adjust_float_expressions.h>
1718
#include <goto-programs/goto_inline.h>
@@ -26,8 +27,7 @@ Author: Martin Brain, [email protected]
2627
#include <goto-programs/string_abstraction.h>
2728
#include <goto-programs/string_instrumentation.h>
2829

29-
#include <util/message.h>
30-
#include <util/options.h>
30+
#include "goto_check.h"
3131

3232
bool process_goto_program(
3333
goto_modelt &goto_model,

0 commit comments

Comments
 (0)