Skip to content

Commit a4b010d

Browse files
author
Daniel Kroening
committed
cbmc: clean out java
1 parent 578410e commit a4b010d

File tree

6 files changed

+8
-57
lines changed

6 files changed

+8
-57
lines changed

src/Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,11 @@ $(patsubst %, %.dir, $(filter-out big-int util, $(DIRS))): util.dir
1919

2020
cpp.dir: ansi-c.dir linking.dir
2121

22+
java_bytecode.dir: miniz.dir
23+
2224
languages: util.dir langapi.dir \
2325
cpp.dir ansi-c.dir xmllang.dir assembler.dir java_bytecode.dir \
24-
jsil.dir miniz.dir
26+
jsil.dir
2527

2628
goto-instrument.dir: languages goto-programs.dir pointer-analysis.dir \
2729
goto-symex.dir linking.dir analyses.dir solvers.dir \
@@ -31,7 +33,7 @@ cbmc.dir: languages solvers.dir goto-symex.dir analyses.dir \
3133
pointer-analysis.dir goto-programs.dir linking.dir \
3234
goto-instrument.dir
3335

34-
jbmc.dir: cbmc.dir
36+
jbmc.dir: java_bytecode.dir cbmc.dir
3537

3638
goto-analyzer.dir: languages analyses.dir goto-programs.dir linking.dir \
3739
json.dir goto-instrument.dir

src/cbmc/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ OBJ += ../ansi-c/ansi-c$(LIBEXT) \
4040
../assembler/assembler$(LIBEXT) \
4141
../solvers/solvers$(LIBEXT) \
4242
../util/util$(LIBEXT) \
43-
../miniz/miniz$(OBJEXT) \
4443
../json/json$(LIBEXT)
4544

4645
INCLUDES= -I ..

src/cbmc/cbmc_languages.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ Author: Daniel Kroening, kroening@kroening.com
1515

1616
#include <ansi-c/ansi_c_language.h>
1717
#include <cpp/cpp_language.h>
18-
#include <java_bytecode/java_bytecode_language.h>
1918

2019
#ifdef HAVE_JSIL
2120
#include <jsil/jsil_language.h>
@@ -25,7 +24,6 @@ void cbmc_parse_optionst::register_languages()
2524
{
2625
register_language(new_ansi_c_language);
2726
register_language(new_cpp_language);
28-
register_language(new_java_bytecode_language);
2927

3028
#ifdef HAVE_JSIL
3129
register_language(new_jsil_language);

src/cbmc/cbmc_parse_options.cpp

Lines changed: 1 addition & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ Author: Daniel Kroening, kroening@kroening.com
4545
#include <goto-programs/remove_unused_functions.h>
4646
#include <goto-programs/remove_skip.h>
4747
#include <goto-programs/remove_static_init_loops.h>
48-
#include <goto-programs/replace_java_nondet.h>
4948
#include <goto-programs/set_properties.h>
5049
#include <goto-programs/show_goto_functions.h>
5150
#include <goto-programs/show_symbol_table.h>
@@ -64,8 +63,6 @@ Author: Daniel Kroening, kroening@kroening.com
6463

6564
#include <langapi/mode.h>
6665

67-
#include "java_bytecode/java_bytecode_language.h"
68-
6966
#include "cbmc_solvers.h"
7067
#include "bmc.h"
7168
#include "version.h"
@@ -192,10 +189,6 @@ void cbmc_parse_optionst::get_command_line_options(optionst &options)
192189
// all checks supported by goto_check
193190
PARSE_OPTIONS_GOTO_CHECK(cmdline, options);
194191

195-
// unwind loops in java enum static initialization
196-
if(cmdline.isset("java-unwind-enum-static"))
197-
options.set_option("java-unwind-enum-static", true);
198-
199192
// check assertions
200193
if(cmdline.isset("no-assertions"))
201194
options.set_option("assertions", false);
@@ -545,11 +538,6 @@ int cbmc_parse_optionst::doit()
545538
if(set_properties())
546539
return 7; // should contemplate EX_USAGE from sysexits.h
547540

548-
// unwinds <clinit> loops to number of enum elements
549-
// side effect: add this as explicit unwind to unwind set
550-
if(options.get_bool_option("java-unwind-enum-static"))
551-
remove_static_init_loops(goto_model, options, get_message_handler());
552-
553541
// get solver
554542
cbmc_solverst cbmc_solvers(
555543
options,
@@ -757,12 +745,10 @@ bool cbmc_parse_optionst::process_goto_program(
757745
get_message_handler(),
758746
goto_model,
759747
cmdline.isset("pointer-check"));
760-
// Java virtual functions -> explicit dispatch tables:
748+
// virtual functions -> explicit dispatch tables:
761749
remove_virtual_functions(goto_model);
762750
// remove catch and throw (introduces instanceof)
763751
remove_exceptions(goto_model);
764-
// Similar removal of RTTI inspection:
765-
remove_instanceof(goto_model);
766752

767753
mm_io(goto_model);
768754

@@ -775,30 +761,6 @@ bool cbmc_parse_optionst::process_goto_program(
775761
remove_complex(goto_model);
776762
rewrite_union(goto_model);
777763

778-
// Similar removal of java nondet statements:
779-
// TODO Should really get this from java_bytecode_language somehow, but we
780-
// don't have an instance of that here.
781-
object_factory_parameterst factory_params;
782-
factory_params.max_nondet_array_length=
783-
cmdline.isset("java-max-input-array-length")
784-
? std::stoul(cmdline.get_value("java-max-input-array-length"))
785-
: MAX_NONDET_ARRAY_LENGTH_DEFAULT;
786-
factory_params.max_nondet_string_length=
787-
cmdline.isset("string-max-input-length")
788-
? std::stoul(cmdline.get_value("string-max-input-length"))
789-
: MAX_NONDET_STRING_LENGTH;
790-
factory_params.max_nondet_tree_depth=
791-
cmdline.isset("java-max-input-tree-depth")
792-
? std::stoul(cmdline.get_value("java-max-input-tree-depth"))
793-
: MAX_NONDET_TREE_DEPTH;
794-
795-
replace_java_nondet(goto_model);
796-
797-
convert_nondet(
798-
goto_model,
799-
get_message_handler(),
800-
factory_params);
801-
802764
// add generic checks
803765
status() << "Generic Property Instrumentation" << eom;
804766
goto_check(options, goto_model);
@@ -873,7 +835,6 @@ bool cbmc_parse_optionst::process_goto_program(
873835

874836
// remove any skips introduced since coverage instrumentation
875837
remove_skip(goto_model);
876-
goto_model.goto_functions.update();
877838
}
878839

879840
catch(const char *e)
@@ -1014,14 +975,6 @@ void cbmc_parse_optionst::help()
1014975
" --cover CC create test-suite with coverage criterion CC\n" // NOLINT(*)
1015976
" --mm MM memory consistency model for concurrent programs\n" // NOLINT(*)
1016977
"\n"
1017-
"Java Bytecode frontend options:\n"
1018-
" --classpath dir/jar set the classpath\n"
1019-
" --main-class class-name set the name of the main class\n"
1020-
JAVA_BYTECODE_LANGUAGE_OPTIONS_HELP
1021-
// This one is handled by cbmc_parse_options not by the Java frontend,
1022-
// hence its presence here:
1023-
" --java-unwind-enum-static try to unwind loops in static initialization of enums\n"
1024-
"\n"
1025978
"Semantic transformations:\n"
1026979
// NOLINTNEXTLINE(whitespace/line_length)
1027980
" --nondet-static add nondeterministic initialization of variables with static lifetime\n"

src/cbmc/cbmc_parse_options.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ Author: Daniel Kroening, kroening@kroening.com
1818

1919
#include <analyses/goto_check.h>
2020

21-
#include <java_bytecode/java_bytecode_language.h>
22-
2321
#include "xml_interface.h"
2422

2523
class bmct;
@@ -67,8 +65,6 @@ class optionst;
6765
"(string-abstraction)(no-arch)(arch):" \
6866
"(round-to-nearest)(round-to-plus-inf)(round-to-minus-inf)(round-to-zero)" \
6967
"(graphml-witness):" \
70-
JAVA_BYTECODE_LANGUAGE_OPTIONS \
71-
"(java-unwind-enum-static)" \
7268
"(localize-faults)(localize-faults-method):" \
7369
"(fixedbv)(floatbv)(all-claims)(all-properties)" // legacy, and will eventually disappear // NOLINT(whitespace/line_length)
7470

src/goto-programs/remove_skip.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,9 @@ void remove_skip(goto_functionst &goto_functions)
157157
{
158158
Forall_goto_functions(f_it, goto_functions)
159159
remove_skip(f_it->second.body);
160+
161+
// we may remove targets
162+
goto_functions.update();
160163
}
161164

162165
void remove_skip(goto_modelt &goto_model)

0 commit comments

Comments
 (0)