Skip to content

Commit a20f2c1

Browse files
Move java_bytecode, jbmc and miniz to jbmc/src
1 parent 987106f commit a20f2c1

File tree

124 files changed

+215
-172
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

124 files changed

+215
-172
lines changed

CMakeLists.txt

+8
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ set(sat_impl "minisat2" CACHE STRING
3535
)
3636

3737
add_subdirectory(src)
38+
add_subdirectory(jbmc)
3839

3940
if(${enable_cbmc_tests})
4041
enable_testing()
@@ -81,6 +82,13 @@ set_target_properties(
8182
util
8283
xml
8384

85+
java_bytecode
86+
jbmc
87+
jbmc-lib
88+
java-testing-utils
89+
java-unit
90+
miniz
91+
8492
PROPERTIES
8593
CXX_STANDARD 11
8694
CXX_STANDARD_REQUIRED true

jbmc/CMakeLists.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
add_subdirectory(regression)
2+
add_subdirectory(src)
3+
add_subdirectory(unit)

jbmc/src/CMakeLists.txt

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
project(JBMC)
2+
3+
# Set the public include locations for a target.
4+
macro(generic_includes name)
5+
target_include_directories(${name}
6+
PUBLIC
7+
${JBMC_BINARY_DIR}
8+
${JBMC_SOURCE_DIR}
9+
${CBMC_BINARY_DIR}
10+
${CBMC_SOURCE_DIR}
11+
${CMAKE_CURRENT_BINARY_DIR}
12+
${CMAKE_CURRENT_SOURCE_DIR}
13+
)
14+
endmacro(generic_includes)
15+
16+
add_subdirectory(miniz)
17+
add_subdirectory(java_bytecode)
18+
add_subdirectory(jbmc)

jbmc/src/Makefile

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
DIRS = jbmc java_bytecode miniz
2+
3+
include config.inc
4+
5+
.PHONY: all
6+
all: jbmc.dir
7+
8+
# building cbmc proper
9+
.PHONY: cprover.dir
10+
cprover.dir:
11+
$(MAKE) $(MAKEARGS) -C $(CPROVER_DIR)/src
12+
13+
.PHONY: java_bytecode.dir
14+
java_bytecode.dir: miniz.dir
15+
16+
.PHONY: jbmc.dir
17+
jbmc.dir: java_bytecode.dir cprover.dir
18+
19+
.PHONY: miniz.dir
20+
miniz.dir:
21+
22+
$(patsubst %, %.dir, $(DIRS)):
23+
## Entering $(basename $@)
24+
$(MAKE) $(MAKEARGS) -C $(basename $@)
25+
26+
# generate source files
27+
28+
$(patsubst %, %_generated_files, $(DIRS)):
29+
$(MAKE) $(MAKEARGS) -C $(patsubst %_generated_files, %, $@) generated_files
30+
31+
.PHONY: generated_files
32+
generated_files: $(patsubst %, %_generated_files, $(DIRS))
33+
34+
# cleaning
35+
36+
.PHONY: clean
37+
clean: $(patsubst %, %_clean, $(DIRS)) cprover_clean
38+
39+
$(patsubst %, %_clean, $(DIRS)):
40+
$(MAKE) $(MAKEARGS) -C $(patsubst %_clean, %, $@) clean ; \
41+
42+
.PHONY: cprover_clean
43+
cprover_clean:
44+
$(MAKE) $(MAKEARGS) -C $(CPROVER_DIR)/src clean

jbmc/src/config.inc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CPROVER_DIR ?= ../..

src/java_bytecode/Makefile renamed to jbmc/src/java_bytecode/Makefile

+3-2
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,11 @@ SRC = bytecode_info.cpp \
4141
simple_method_stubbing.cpp \
4242
# Empty last line
4343

44-
INCLUDES= -I ..
44+
INCLUDES= -I .. -I ../$(CPROVER_DIR)/src
4545

4646
include ../config.inc
47-
include ../common
47+
include ../$(CPROVER_DIR)/src/config.inc
48+
include ../$(CPROVER_DIR)/src/common
4849

4950
CLEANFILES = java_bytecode$(LIBEXT)
5051

src/java_bytecode/bytecode_info.cpp renamed to jbmc/src/java_bytecode/bytecode_info.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Author: Daniel Kroening, [email protected]
1212

1313
#include "bytecode_info.h"
1414

15+
// clang-format off
1516
struct bytecode_infot const bytecode_info[]=
1617
{
1718
{ "aaload", 0x32, ' ', 2, 1, ' ' }, // arrayref, index → value; load onto the stack a reference from an array NOLINT(*)
@@ -221,3 +222,4 @@ struct bytecode_infot const bytecode_info[]=
221222
{ "wide", 0xc4, ' ', 0, 0, ' ' }, // modifier for others NOLINT(*)
222223
{ nullptr, 0x00, '\0',0, 0, '\0'}, // zero-initialized NOLINT (*)
223224
};
225+
// clang-format on
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/java_bytecode/java_bytecode_language.cpp renamed to jbmc/src/java_bytecode/java_bytecode_language.cpp

+5-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Author: Daniel Kroening, [email protected]
3434
#include "java_string_literals.h"
3535
#include "java_static_initializers.h"
3636
#include "java_utils.h"
37-
#include <java_bytecode/ci_lazy_methods.h>
37+
#include "ci_lazy_methods.h"
3838

3939
#include "expr2java.h"
4040

@@ -124,7 +124,10 @@ void java_bytecode_languaget::get_language_options(const cmdlinet &cmd)
124124
// add jars from JSON config file to classpath
125125
for(const jsont &file_entry : include_files.array)
126126
{
127-
assert(file_entry.is_string() && has_suffix(file_entry.value, ".jar"));
127+
DATA_INVARIANT(
128+
file_entry.is_string() && has_suffix(file_entry.value, ".jar"),
129+
"classpath entry must be jar filename, but '" + file_entry.value +
130+
"' found");
128131
config.java.classpath.push_back(file_entry.value);
129132
}
130133
}
File renamed without changes.
File renamed without changes.

src/java_bytecode/library/Makefile renamed to jbmc/src/java_bytecode/library/Makefile

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
SRC = converter.cpp
66

77
include ../../config.inc
8-
include ../../common
8+
include ../../$(CPROVER_DIR)/src/config.inc
9+
include ../../$(CPROVER_DIR)/src/common
910

1011
SOURCE_DIR := src
1112
BINARY_DIR := classes

src/jbmc/CMakeLists.txt renamed to jbmc/src/jbmc/CMakeLists.txt

+1-5
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,22 @@ generic_includes(jbmc-lib)
1010
target_link_libraries(jbmc-lib
1111
analyses
1212
ansi-c
13-
assembler
1413
big-int
1514
cbmc-lib
16-
cpp
1715
goto-instrument-lib
1816
goto-programs
1917
goto-symex
2018
java_bytecode
2119
json
2220
langapi
2321
linking
22+
miniz
2423
pointer-analysis
2524
solvers
2625
util
2726
xml
2827
)
2928

30-
add_if_library(jbmc-lib bv_refinement)
31-
add_if_library(jbmc-lib jsil)
32-
3329
# Executable
3430
add_executable(jbmc jbmc_main.cpp)
3531
target_link_libraries(jbmc jbmc-lib)

jbmc/src/jbmc/Makefile

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
SRC = jbmc_main.cpp \
2+
jbmc_parse_options.cpp \
3+
# Empty last line
4+
5+
OBJ += ../$(CPROVER_DIR)/src/ansi-c/ansi-c$(LIBEXT) \
6+
../java_bytecode/java_bytecode$(LIBEXT) \
7+
../$(CPROVER_DIR)/src/linking/linking$(LIBEXT) \
8+
../$(CPROVER_DIR)/src/big-int/big-int$(LIBEXT) \
9+
../$(CPROVER_DIR)/src/goto-programs/goto-programs$(LIBEXT) \
10+
../$(CPROVER_DIR)/src/goto-symex/goto-symex$(LIBEXT) \
11+
../$(CPROVER_DIR)/src/pointer-analysis/value_set$(OBJEXT) \
12+
../$(CPROVER_DIR)/src/pointer-analysis/value_set_analysis_fi$(OBJEXT) \
13+
../$(CPROVER_DIR)/src/pointer-analysis/value_set_domain_fi$(OBJEXT) \
14+
../$(CPROVER_DIR)/src/pointer-analysis/value_set_fi$(OBJEXT) \
15+
../$(CPROVER_DIR)/src/pointer-analysis/value_set_dereference$(OBJEXT) \
16+
../$(CPROVER_DIR)/src/pointer-analysis/dereference_callback$(OBJEXT) \
17+
../$(CPROVER_DIR)/src/pointer-analysis/add_failed_symbols$(OBJEXT) \
18+
../$(CPROVER_DIR)/src/pointer-analysis/rewrite_index$(OBJEXT) \
19+
../$(CPROVER_DIR)/src/pointer-analysis/goto_program_dereference$(OBJEXT) \
20+
../$(CPROVER_DIR)/src/goto-instrument/full_slicer$(OBJEXT) \
21+
../$(CPROVER_DIR)/src/goto-instrument/reachability_slicer$(OBJEXT) \
22+
../$(CPROVER_DIR)/src/goto-instrument/nondet_static$(OBJEXT) \
23+
../$(CPROVER_DIR)/src/goto-instrument/cover$(OBJEXT) \
24+
../$(CPROVER_DIR)/src/goto-instrument/cover_basic_blocks$(OBJEXT) \
25+
../$(CPROVER_DIR)/src/goto-instrument/cover_filter$(OBJEXT) \
26+
../$(CPROVER_DIR)/src/goto-instrument/cover_instrument_branch$(OBJEXT) \
27+
../$(CPROVER_DIR)/src/goto-instrument/cover_instrument_condition$(OBJEXT) \
28+
../$(CPROVER_DIR)/src/goto-instrument/cover_instrument_decision$(OBJEXT) \
29+
../$(CPROVER_DIR)/src/goto-instrument/cover_instrument_location$(OBJEXT) \
30+
../$(CPROVER_DIR)/src/goto-instrument/cover_instrument_mcdc$(OBJEXT) \
31+
../$(CPROVER_DIR)/src/goto-instrument/cover_instrument_other$(OBJEXT) \
32+
../$(CPROVER_DIR)/src/goto-instrument/cover_util$(OBJEXT) \
33+
../$(CPROVER_DIR)/src/goto-instrument/unwindset$(OBJEXT) \
34+
../$(CPROVER_DIR)/src/analyses/analyses$(LIBEXT) \
35+
../$(CPROVER_DIR)/src/langapi/langapi$(LIBEXT) \
36+
../$(CPROVER_DIR)/src/xmllang/xmllang$(LIBEXT) \
37+
../$(CPROVER_DIR)/src/solvers/solvers$(LIBEXT) \
38+
../$(CPROVER_DIR)/src/util/util$(LIBEXT) \
39+
../miniz/miniz$(OBJEXT) \
40+
../$(CPROVER_DIR)/src/json/json$(LIBEXT) \
41+
../$(CPROVER_DIR)/src/cbmc/all_properties$(OBJEXT) \
42+
../$(CPROVER_DIR)/src/cbmc/bmc$(OBJEXT) \
43+
../$(CPROVER_DIR)/src/cbmc/bmc_cover$(OBJEXT) \
44+
../$(CPROVER_DIR)/src/cbmc/bv_cbmc$(OBJEXT) \
45+
../$(CPROVER_DIR)/src/cbmc/cbmc_dimacs$(OBJEXT) \
46+
../$(CPROVER_DIR)/src/cbmc/cbmc_solvers$(OBJEXT) \
47+
../$(CPROVER_DIR)/src/cbmc/counterexample_beautification$(OBJEXT) \
48+
../$(CPROVER_DIR)/src/cbmc/fault_localization$(OBJEXT) \
49+
../$(CPROVER_DIR)/src/cbmc/show_vcc$(OBJEXT) \
50+
../$(CPROVER_DIR)/src/cbmc/symex_bmc$(OBJEXT) \
51+
../$(CPROVER_DIR)/src/cbmc/symex_coverage$(OBJEXT) \
52+
# Empty last line
53+
54+
INCLUDES= -I .. -I ../$(CPROVER_DIR)/src
55+
56+
LIBS =
57+
58+
include ../config.inc
59+
include ../$(CPROVER_DIR)/src/config.inc
60+
include ../$(CPROVER_DIR)/src/common
61+
62+
CLEANFILES = jbmc$(EXEEXT)
63+
64+
all: jbmc$(EXEEXT)
65+
66+
###############################################################################
67+
68+
jbmc$(EXEEXT): $(OBJ)
69+
$(LINKBIN)
70+
71+
.PHONY: jbmc-mac-signed
72+
73+
jbmc-mac-signed: jbmc$(EXEEXT)
74+
strip jbmc$(EXEEXT) ; codesign -v -s $(OSX_IDENTITY) jbmc$(EXEEXT)
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/miniz/Makefile renamed to jbmc/src/miniz/Makefile

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
SRC = miniz.cpp \
22
# Empty last line
3+
34
INCLUDES= -I ..
45

56
include ../config.inc
6-
include ../common
7+
include ../$(CPROVER_DIR)/src/config.inc
8+
include ../$(CPROVER_DIR)/src/common
79

810
CLEANFILES = miniz$(OBJEXT)
911

File renamed without changes.
File renamed without changes.

src/CMakeLists.txt

-3
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,9 @@ add_subdirectory(pointer-analysis)
9696
add_subdirectory(solvers)
9797
add_subdirectory(util)
9898
add_subdirectory(xmllang)
99-
add_subdirectory(java_bytecode)
100-
add_subdirectory(miniz)
10199
add_subdirectory(clobber)
102100

103101
add_subdirectory(cbmc)
104-
add_subdirectory(jbmc)
105102
add_subdirectory(goto-cc)
106103
add_subdirectory(goto-instrument)
107104
add_subdirectory(goto-analyzer)

src/Makefile

+32-22
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,33 @@
1-
DIRS = ansi-c big-int cbmc jbmc cpp goto-cc goto-instrument goto-programs \
2-
goto-symex langapi pointer-analysis solvers util linking xmllang \
3-
assembler analyses java_bytecode \
4-
json goto-analyzer jsil goto-diff clobber \
5-
memory-models miniz
6-
7-
all: cbmc.dir jbmc.dir goto-cc.dir goto-instrument.dir \
8-
goto-analyzer.dir goto-diff.dir
1+
DIRS = analyses \
2+
ansi-c \
3+
assembler \
4+
big-int \
5+
cbmc \
6+
clobber \
7+
cpp \
8+
goto-analyzer \
9+
goto-cc \
10+
goto-diff \
11+
goto-instrument \
12+
goto-programs \
13+
goto-symex \
14+
jsil \
15+
json \
16+
langapi \
17+
linking \
18+
memory-models \
19+
pointer-analysis \
20+
solvers \
21+
util \
22+
xmllang \
23+
# Empty last line
24+
25+
all: cbmc.dir \
26+
goto-analyzer.dir \
27+
goto-cc.dir \
28+
goto-diff.dir \
29+
goto-instrument.dir \
30+
# Empty last line
931

1032
###############################################################################
1133

@@ -19,10 +41,8 @@ $(patsubst %, %.dir, $(filter-out big-int util, $(DIRS))): util.dir
1941

2042
cpp.dir: ansi-c.dir linking.dir
2143

22-
java_bytecode.dir: miniz.dir
23-
2444
languages: util.dir langapi.dir \
25-
cpp.dir ansi-c.dir xmllang.dir assembler.dir java_bytecode.dir \
45+
cpp.dir ansi-c.dir xmllang.dir assembler.dir \
2646
jsil.dir
2747

2848
solvers.dir: util.dir langapi.dir
@@ -35,8 +55,6 @@ cbmc.dir: languages solvers.dir goto-symex.dir analyses.dir \
3555
pointer-analysis.dir goto-programs.dir linking.dir \
3656
goto-instrument.dir
3757

38-
jbmc.dir: java_bytecode.dir cbmc.dir
39-
4058
goto-analyzer.dir: languages analyses.dir goto-programs.dir linking.dir \
4159
json.dir goto-instrument.dir
4260

@@ -88,14 +106,6 @@ glucose-download:
88106
@(cd ../glucose-syrup; patch -p1 < ../scripts/glucose-syrup-patch)
89107
@rm glucose-syrup.tgz
90108

91-
cprover-jar-build:
92-
@echo "Building org.cprover.jar"
93-
@(cd java_bytecode/library/; \
94-
mkdir -p target; \
95-
javac -d target/ `find src/ -name "*.java"`; \
96-
cd target; jar cf org.cprover.jar `find . -name "*.class"`; \
97-
mv org.cprover.jar ../../../)
98-
99109
ipasir-download:
100110
# get the 2016 version of the ipasir package, which contains a few solvers
101111
@echo "Download ipasir 2016 package"
@@ -121,4 +131,4 @@ cadical-download:
121131
doc :
122132
doxygen
123133

124-
.PHONY: ipasir-build minisat2-download glucose-download cprover-jar-build
134+
.PHONY: ipasir-build minisat2-download glucose-download

src/clobber/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ OBJ += ../ansi-c/ansi-c$(LIBEXT) \
1717
../pointer-analysis/dereference$(OBJEXT) \
1818
../goto-instrument/dump_c$(OBJEXT) \
1919
../goto-instrument/goto_program2code$(OBJEXT) \
20-
../miniz/miniz$(OBJEXT)
20+
# Empty last line
2121

2222
INCLUDES= -I ..
2323

src/clobber/clobber_parse_options.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -415,8 +415,6 @@ void clobber_parse_optionst::help()
415415
" --round-to-minus-inf IEEE floating point rounding mode\n"
416416
" --round-to-zero IEEE floating point rounding mode\n"
417417
"\n"
418-
JAVA_BYTECODE_LANGUAGE_OPTIONS_HELP
419-
"\n"
420418
"Program instrumentation options:\n"
421419
HELP_GOTO_CHECK
422420
" --show-properties show the properties\n"

src/clobber/clobber_parse_options.h

-3
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ Author: Daniel Kroening, [email protected]
2121
#include <goto-programs/show_goto_functions.h>
2222
#include <goto-programs/show_properties.h>
2323

24-
#include <java_bytecode/java_bytecode_language.h>
25-
2624
class goto_functionst;
2725
class optionst;
2826

@@ -38,7 +36,6 @@ class optionst;
3836
"(string-abstraction)" \
3937
"(show-locs)(show-vcc)(show-trace)" \
4038
"(property):" \
41-
JAVA_BYTECODE_LANGUAGE_OPTIONS
4239
// clang-format on
4340

4441
class clobber_parse_optionst:

0 commit comments

Comments
 (0)