Skip to content

Commit 6ff1eec

Browse files
Daniel Kroeningpeterschrammel
Daniel Kroening
authored andcommitted
cbmc: remove dependency on java_bytecode
1 parent 0bff19b commit 6ff1eec

18 files changed

+40
-38
lines changed

src/cbmc/CMakeLists.txt

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ target_link_libraries(cbmc-lib
1616
goto-instrument-lib
1717
goto-programs
1818
goto-symex
19-
java_bytecode
2019
json
2120
langapi
2221
linking

src/cbmc/Makefile

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ SRC = all_properties.cpp \
1717

1818
OBJ += ../ansi-c/ansi-c$(LIBEXT) \
1919
../cpp/cpp$(LIBEXT) \
20-
../java_bytecode/java_bytecode$(LIBEXT) \
2120
../linking/linking$(LIBEXT) \
2221
../big-int/big-int$(LIBEXT) \
2322
../goto-programs/goto-programs$(LIBEXT) \

src/cbmc/cbmc_parse_options.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@ Author: Daniel Kroening, [email protected]
3636
#include <goto-programs/mm_io.h>
3737
#include <goto-programs/read_goto_binary.h>
3838
#include <goto-programs/remove_function_pointers.h>
39-
#include <goto-programs/remove_instanceof.h>
4039
#include <goto-programs/remove_returns.h>
41-
#include <goto-programs/remove_exceptions.h>
4240
#include <goto-programs/remove_vector.h>
4341
#include <goto-programs/remove_complex.h>
4442
#include <goto-programs/remove_asm.h>
@@ -760,8 +758,6 @@ bool cbmc_parse_optionst::process_goto_program(
760758
log.get_message_handler(),
761759
goto_model,
762760
options.get_bool_option("pointer-check"));
763-
// remove catch and throw (introduces instanceof)
764-
remove_exceptions(goto_model);
765761

766762
mm_io(goto_model);
767763

src/goto-analyzer/goto_analyzer_parse_options.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ Author: Daniel Kroening, [email protected]
2525
#include <goto-programs/set_properties.h>
2626
#include <goto-programs/remove_function_pointers.h>
2727
#include <goto-programs/remove_virtual_functions.h>
28-
#include <goto-programs/remove_exceptions.h>
29-
#include <goto-programs/remove_instanceof.h>
3028
#include <goto-programs/remove_returns.h>
3129
#include <goto-programs/remove_vector.h>
3230
#include <goto-programs/remove_complex.h>
@@ -45,6 +43,9 @@ Author: Daniel Kroening, [email protected]
4543
#include <analyses/dependence_graph.h>
4644
#include <analyses/interval_domain.h>
4745

46+
#include <java_bytecode/remove_exceptions.h>
47+
#include <java_bytecode/remove_instanceof.h>
48+
4849
#include <langapi/mode.h>
4950
#include <langapi/language.h>
5051

src/goto-diff/goto_diff_parse_options.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@ Author: Peter Schrammel
2929
#include <goto-programs/mm_io.h>
3030
#include <goto-programs/remove_function_pointers.h>
3131
#include <goto-programs/remove_virtual_functions.h>
32-
#include <goto-programs/remove_instanceof.h>
3332
#include <goto-programs/remove_returns.h>
34-
#include <goto-programs/remove_exceptions.h>
3533
#include <goto-programs/remove_vector.h>
3634
#include <goto-programs/remove_complex.h>
3735
#include <goto-programs/remove_asm.h>
@@ -54,6 +52,8 @@ Author: Peter Schrammel
5452
#include <pointer-analysis/add_failed_symbols.h>
5553

5654
#include <java_bytecode/java_bytecode_language.h>
55+
#include <java_bytecode/remove_instanceof.h>
56+
#include <java_bytecode/remove_exceptions.h>
5757

5858
#include <langapi/mode.h>
5959

src/goto-instrument/goto_instrument_parse_options.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ Author: Daniel Kroening, [email protected]
2626
#include <goto-programs/remove_calls_no_body.h>
2727
#include <goto-programs/remove_function_pointers.h>
2828
#include <goto-programs/remove_virtual_functions.h>
29-
#include <goto-programs/remove_exceptions.h>
30-
#include <goto-programs/remove_instanceof.h>
3129
#include <goto-programs/remove_skip.h>
3230
#include <goto-programs/goto_inline.h>
3331
#include <goto-programs/show_properties.h>
@@ -51,6 +49,9 @@ Author: Daniel Kroening, [email protected]
5149
#include <pointer-analysis/add_failed_symbols.h>
5250
#include <pointer-analysis/show_value_sets.h>
5351

52+
#include <java_bytecode/remove_exceptions.h>
53+
#include <java_bytecode/remove_instanceof.h>
54+
5455
#include <analyses/natural_loops.h>
5556
#include <analyses/global_may_alias.h>
5657
#include <analyses/local_bitvector_analysis.h>

src/goto-programs/Makefile

-2
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,7 @@ SRC = basic_blocks.cpp \
4343
remove_calls_no_body.cpp \
4444
remove_complex.cpp \
4545
remove_const_function_pointers.cpp \
46-
remove_exceptions.cpp \
4746
remove_function_pointers.cpp \
48-
remove_instanceof.cpp \
4947
remove_returns.cpp \
5048
remove_skip.cpp \
5149
remove_unreachable.cpp \

src/java_bytecode/Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ SRC = bytecode_info.cpp \
3131
java_types.cpp \
3232
java_utils.cpp \
3333
mz_zip_archive.cpp \
34+
remove_exceptions.cpp \
35+
remove_instanceof.cpp \
3436
select_pointer_type.cpp \
3537
# Empty last line
3638

src/java_bytecode/ci_lazy_methods.cpp

+6-5
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,17 @@
55
Author: Diffblue Ltd.
66
77
\*******************************************************************/
8+
89
#include "ci_lazy_methods.h"
10+
#include "java_entry_point.h"
11+
#include "java_class_loader.h"
12+
#include "java_utils.h"
13+
#include "java_string_library_preprocess.h"
14+
#include "remove_exceptions.h"
915

10-
#include <java_bytecode/java_entry_point.h>
11-
#include <java_bytecode/java_class_loader.h>
12-
#include <java_bytecode/java_utils.h>
1316
#include <util/suffix.h>
14-
#include <java_bytecode/java_string_library_preprocess.h>
1517

1618
#include <goto-programs/resolve_inherited_component.h>
17-
#include <goto-programs/remove_exceptions.h>
1819

1920
/// Constructor for lazy-method loading
2021
/// \param symbol_table: the symbol table to use

src/java_bytecode/java_bytecode_convert_method.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Author: Daniel Kroening, [email protected]
2020
#include "java_string_library_preprocess.h"
2121
#include "java_types.h"
2222
#include "java_utils.h"
23+
#include "remove_exceptions.h"
2324

2425
#include <util/arith_tools.h>
2526
#include <util/c_types.h>
@@ -34,7 +35,6 @@ Author: Daniel Kroening, [email protected]
3435
#include <linking/zero_initializer.h>
3536

3637
#include <goto-programs/cfg.h>
37-
#include <goto-programs/remove_exceptions.h>
3838
#include <goto-programs/class_hierarchy.h>
3939
#include <goto-programs/resolve_inherited_component.h>
4040
#include <analyses/cfg_dominators.h>

src/java_bytecode/java_bytecode_internal_additions.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@ Author: Daniel Kroening, [email protected]
88

99
#include "java_bytecode_internal_additions.h"
1010

11+
// For INFLIGHT_EXCEPTION_VARIABLE_NAME
12+
#include "remove_exceptions.h"
13+
1114
#include <util/std_types.h>
1215
#include <util/cprover_prefix.h>
1316
#include <util/c_types.h>
14-
// For INFLIGHT_EXCEPTION_VARIABLE_NAME
15-
#include <goto-programs/remove_exceptions.h>
1617

1718
void java_internal_additions(symbol_table_baset &dest)
1819
{

src/java_bytecode/java_entry_point.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ Author: Daniel Kroening, [email protected]
2929
#include <util/string_constant.h>
3030
#include <util/suffix.h>
3131

32-
#include <goto-programs/remove_exceptions.h>
33-
32+
#include "remove_exceptions.h"
3433
#include "java_object_factory.h"
3534
#include "java_types.h"
3635
#include "java_utils.h"

src/goto-programs/remove_exceptions.h renamed to src/java_bytecode/remove_exceptions.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ Date: December 2016
1111
/// \file
1212
/// Remove function exceptional returns
1313

14-
#ifndef CPROVER_GOTO_PROGRAMS_REMOVE_EXCEPTIONS_H
15-
#define CPROVER_GOTO_PROGRAMS_REMOVE_EXCEPTIONS_H
14+
#ifndef CPROVER_JAVA_BYTECODE_REMOVE_EXCEPTIONS_H
15+
#define CPROVER_JAVA_BYTECODE_REMOVE_EXCEPTIONS_H
1616

1717
#include <goto-programs/goto_model.h>
1818

src/goto-programs/remove_instanceof.cpp renamed to src/java_bytecode/remove_instanceof.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ Author: Chris Smowton, [email protected]
1111

1212
#include "remove_instanceof.h"
1313

14-
#include "class_hierarchy.h"
15-
#include "class_identifier.h"
14+
#include <goto-programs/class_hierarchy.h>
15+
#include <goto-programs/class_identifier.h>
1616

1717
#include <util/fresh_symbol.h>
1818
#include <java_bytecode/java_types.h>

src/goto-programs/remove_instanceof.h renamed to src/java_bytecode/remove_instanceof.h

+5-4
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@ Author: Chris Smowton, [email protected]
99
/// \file
1010
/// Remove Instance-of Operators
1111

12-
#ifndef CPROVER_GOTO_PROGRAMS_REMOVE_INSTANCEOF_H
13-
#define CPROVER_GOTO_PROGRAMS_REMOVE_INSTANCEOF_H
12+
#ifndef CPROVER_JAVA_BYTECODE_REMOVE_INSTANCEOF_H
13+
#define CPROVER_JAVA_BYTECODE_REMOVE_INSTANCEOF_H
1414

1515
#include <util/symbol_table.h>
16-
#include "goto_functions.h"
17-
#include "goto_model.h"
16+
17+
#include <goto-programs/goto_functions.h>
18+
#include <goto-programs/goto_model.h>
1819

1920
void remove_instanceof(
2021
goto_programt::targett target,

src/jbmc/jbmc_parse_options.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@ Author: Daniel Kroening, [email protected]
3232
#include <goto-programs/goto_inline.h>
3333
#include <goto-programs/loop_ids.h>
3434
#include <goto-programs/remove_virtual_functions.h>
35-
#include <goto-programs/remove_instanceof.h>
3635
#include <goto-programs/remove_returns.h>
37-
#include <goto-programs/remove_exceptions.h>
3836
#include <goto-programs/remove_asm.h>
3937
#include <goto-programs/remove_unused_functions.h>
4038
#include <goto-programs/remove_skip.h>
@@ -56,6 +54,8 @@ Author: Daniel Kroening, [email protected]
5654

5755
#include <java_bytecode/java_bytecode_language.h>
5856
#include <java_bytecode/java_enum_static_init_unwind_handler.h>
57+
#include <java_bytecode/remove_instanceof.h>
58+
#include <java_bytecode/remove_exceptions.h>
5959

6060
#include <cbmc/version.h>
6161

unit/java_bytecode/java_replace_nondet/replace_nondet.cpp

+8-4
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,17 @@
1212

1313
#include <goto-programs/goto_convert_functions.h>
1414
#include <goto-programs/remove_virtual_functions.h>
15+
#include <goto-programs/remove_returns.h>
16+
#include <goto-programs/replace_java_nondet.h>
17+
18+
#include <java_bytecode/remove_instanceof.h>
19+
1520
#include <util/config.h>
16-
#include <goto-instrument/cover.h>
1721
#include <util/options.h>
22+
23+
#include <goto-instrument/cover.h>
24+
1825
#include <iostream>
19-
#include <goto-programs/remove_returns.h>
20-
#include <goto-programs/replace_java_nondet.h>
21-
#include <goto-programs/remove_instanceof.h>
2226

2327
void validate_method_removal(
2428
std::list<goto_programt::instructiont> instructions)

0 commit comments

Comments
 (0)