diff --git a/jbmc/src/java_bytecode/Makefile b/jbmc/src/java_bytecode/Makefile index 2fb7e8ba450..3dd396bf345 100644 --- a/jbmc/src/java_bytecode/Makefile +++ b/jbmc/src/java_bytecode/Makefile @@ -48,6 +48,7 @@ SRC = assignments_from_json.cpp \ lift_clinit_calls.cpp \ load_method_by_regex.cpp \ mz_zip_archive.cpp \ + nondet.cpp \ remove_exceptions.cpp \ remove_instanceof.cpp \ remove_java_new.cpp \ diff --git a/jbmc/src/java_bytecode/assignments_from_json.cpp b/jbmc/src/java_bytecode/assignments_from_json.cpp index bbd08e5952d..783b51dd1ef 100644 --- a/jbmc/src/java_bytecode/assignments_from_json.cpp +++ b/jbmc/src/java_bytecode/assignments_from_json.cpp @@ -15,9 +15,9 @@ Author: Diffblue Ltd. #include "java_types.h" #include "java_utils.h" +#include #include -#include #include #include #include diff --git a/jbmc/src/java_bytecode/java_entry_point.cpp b/jbmc/src/java_bytecode/java_entry_point.cpp index 02d235a9446..69f3acf669a 100644 --- a/jbmc/src/java_bytecode/java_entry_point.cpp +++ b/jbmc/src/java_bytecode/java_entry_point.cpp @@ -11,7 +11,6 @@ Author: Daniel Kroening, kroening@kroening.com #include #include #include -#include #include #include @@ -26,6 +25,7 @@ Author: Daniel Kroening, kroening@kroening.com #include "java_string_literals.h" #include "java_types.h" #include "java_utils.h" +#include "nondet.h" #include diff --git a/jbmc/src/java_bytecode/java_object_factory.cpp b/jbmc/src/java_bytecode/java_object_factory.cpp index 029bb708acb..ce7df5cfa16 100644 --- a/jbmc/src/java_bytecode/java_object_factory.cpp +++ b/jbmc/src/java_bytecode/java_object_factory.cpp @@ -12,7 +12,6 @@ Author: Daniel Kroening, kroening@kroening.com #include #include #include -#include #include #include diff --git a/jbmc/src/java_bytecode/java_object_factory.h b/jbmc/src/java_bytecode/java_object_factory.h index e6af429c33a..7f2e0edcd2d 100644 --- a/jbmc/src/java_bytecode/java_object_factory.h +++ b/jbmc/src/java_bytecode/java_object_factory.h @@ -71,8 +71,10 @@ Author: Daniel Kroening, kroening@kroening.com #ifndef CPROVER_JAVA_BYTECODE_JAVA_OBJECT_FACTORY_H #define CPROVER_JAVA_BYTECODE_JAVA_OBJECT_FACTORY_H -#include -#include +#include "nondet.h" + +#include + #include class message_handlert; diff --git a/jbmc/src/java_bytecode/java_string_library_preprocess.cpp b/jbmc/src/java_bytecode/java_string_library_preprocess.cpp index 75a2fbf4823..18805b5496d 100644 --- a/jbmc/src/java_bytecode/java_string_library_preprocess.cpp +++ b/jbmc/src/java_bytecode/java_string_library_preprocess.cpp @@ -16,9 +16,9 @@ Date: April 2017 /// java standard library. In particular methods from java.lang.String, /// java.lang.StringBuilder, java.lang.StringBuffer. +#include #include -#include #include #include #include diff --git a/src/util/nondet.cpp b/jbmc/src/java_bytecode/nondet.cpp similarity index 98% rename from src/util/nondet.cpp rename to jbmc/src/java_bytecode/nondet.cpp index 3634580c838..26ee6036080 100644 --- a/src/util/nondet.cpp +++ b/jbmc/src/java_bytecode/nondet.cpp @@ -8,8 +8,9 @@ Author: Diffblue Ltd. #include "nondet.h" -#include "allocate_objects.h" -#include "arith_tools.h" +#include + +#include symbol_exprt generate_nondet_int( const exprt &min_value_expr, diff --git a/src/util/nondet.h b/jbmc/src/java_bytecode/nondet.h similarity index 99% rename from src/util/nondet.h rename to jbmc/src/java_bytecode/nondet.h index 212e9581f32..dfd9a2cd9ec 100644 --- a/src/util/nondet.h +++ b/jbmc/src/java_bytecode/nondet.h @@ -9,7 +9,7 @@ Author: Diffblue Ltd. #ifndef CPROVER_JAVA_BYTECODE_NONDET_H #define CPROVER_JAVA_BYTECODE_NONDET_H -#include "std_code.h" +#include class allocate_objectst; class symbol_table_baset; diff --git a/src/ansi-c/c_nondet_symbol_factory.cpp b/src/ansi-c/c_nondet_symbol_factory.cpp index ad3cc091755..5f7bf099c30 100644 --- a/src/ansi-c/c_nondet_symbol_factory.cpp +++ b/src/ansi-c/c_nondet_symbol_factory.cpp @@ -13,7 +13,6 @@ Author: Diffblue Ltd. #include -#include #include #include #include @@ -21,6 +20,7 @@ Author: Diffblue Ltd. #include #include +#include #include /// Creates a nondet for expr, including calling itself recursively to make diff --git a/src/ansi-c/c_nondet_symbol_factory.h b/src/ansi-c/c_nondet_symbol_factory.h index 9777acefadc..16afdf271e7 100644 --- a/src/ansi-c/c_nondet_symbol_factory.h +++ b/src/ansi-c/c_nondet_symbol_factory.h @@ -14,7 +14,8 @@ Author: Diffblue Ltd. #include -#include +#include + #include struct c_object_factory_parameterst; diff --git a/src/goto-harness/function_call_harness_generator.cpp b/src/goto-harness/function_call_harness_generator.cpp index 85fecb83a27..1d69c96a393 100644 --- a/src/goto-harness/function_call_harness_generator.cpp +++ b/src/goto-harness/function_call_harness_generator.cpp @@ -8,7 +8,6 @@ Author: Diffblue Ltd. #include "function_call_harness_generator.h" -#include #include #include #include @@ -18,6 +17,7 @@ Author: Diffblue Ltd. #include #include +#include #include #include diff --git a/src/goto-programs/Makefile b/src/goto-programs/Makefile index 1ad85c9b469..86063c6bbf3 100644 --- a/src/goto-programs/Makefile +++ b/src/goto-programs/Makefile @@ -1,4 +1,5 @@ -SRC = add_malloc_may_fail_variable_initializations.cpp \ +SRC = allocate_objects.cpp \ + add_malloc_may_fail_variable_initializations.cpp \ adjust_float_expressions.cpp \ builtin_functions.cpp \ class_hierarchy.cpp \ diff --git a/src/util/allocate_objects.cpp b/src/goto-programs/allocate_objects.cpp similarity index 98% rename from src/util/allocate_objects.cpp rename to src/goto-programs/allocate_objects.cpp index 1c73b829edc..49e2593622d 100644 --- a/src/util/allocate_objects.cpp +++ b/src/goto-programs/allocate_objects.cpp @@ -8,11 +8,11 @@ Author: Daniel Kroening, kroening@kroening.com #include "allocate_objects.h" -#include "c_types.h" -#include "fresh_symbol.h" -#include "pointer_expr.h" -#include "pointer_offset_size.h" -#include "symbol.h" +#include +#include +#include +#include +#include /// Allocates a new object, either by creating a local variable with automatic /// lifetime, a global variable with static lifetime, or by dynamically diff --git a/src/util/allocate_objects.h b/src/goto-programs/allocate_objects.h similarity index 97% rename from src/util/allocate_objects.h rename to src/goto-programs/allocate_objects.h index 1de4e917a16..fbc17a82ab2 100644 --- a/src/util/allocate_objects.h +++ b/src/goto-programs/allocate_objects.h @@ -9,9 +9,9 @@ Author: Daniel Kroening, kroening@kroening.com #ifndef CPROVER_UTIL_ALLOCATE_OBJECTS_H #define CPROVER_UTIL_ALLOCATE_OBJECTS_H -#include "goto_instruction_code.h" -#include "namespace.h" -#include "source_location.h" +#include +#include +#include /// Selects the kind of objects allocated enum class lifetimet diff --git a/src/goto-programs/goto_convert_class.h b/src/goto-programs/goto_convert_class.h index 54050055f2e..d342cd0e98d 100644 --- a/src/goto-programs/goto_convert_class.h +++ b/src/goto-programs/goto_convert_class.h @@ -16,14 +16,14 @@ Author: Daniel Kroening, kroening@kroening.com #include #include -#include #include #include #include #include -#include "goto_program.h" +#include "allocate_objects.h" #include "destructor_tree.h" +#include "goto_program.h" class side_effect_expr_overflowt; diff --git a/src/memory-analyzer/analyze_symbol.h b/src/memory-analyzer/analyze_symbol.h index 69bdce5e4c4..20deb6b02c5 100644 --- a/src/memory-analyzer/analyze_symbol.h +++ b/src/memory-analyzer/analyze_symbol.h @@ -20,12 +20,13 @@ Author: Malte Mues #include -#include #include #include #include #include +#include + class gdb_apit; class exprt; class source_locationt; diff --git a/src/util/Makefile b/src/util/Makefile index b502999746a..f0500140f70 100644 --- a/src/util/Makefile +++ b/src/util/Makefile @@ -1,5 +1,4 @@ -SRC = allocate_objects.cpp \ - arith_tools.cpp \ +SRC = arith_tools.cpp \ array_element_from_pointer.cpp \ array_name.cpp \ base_type.cpp \ @@ -54,7 +53,6 @@ SRC = allocate_objects.cpp \ message.cpp \ mp_arith.cpp \ namespace.cpp \ - nondet.cpp \ object_factory_parameters.cpp \ options.cpp \ parse_options.cpp \ diff --git a/unit/Makefile b/unit/Makefile index fdcbef5d934..96fcb1b47be 100644 --- a/unit/Makefile +++ b/unit/Makefile @@ -59,6 +59,7 @@ SRC += analyses/ai/ai.cpp \ goto-checker/report_util/is_property_less_than.cpp \ goto-instrument/cover_instrument.cpp \ goto-instrument/cover/cover_only.cpp \ + goto-programs/allocate_objects.cpp \ goto-programs/goto_program_assume.cpp \ goto-programs/goto_program_dead.cpp \ goto-programs/goto_program_declaration.cpp \ @@ -118,7 +119,6 @@ SRC += analyses/ai/ai.cpp \ solvers/strings/string_refinement/string_refinement.cpp \ solvers/strings/string_refinement/substitute_array_list.cpp \ solvers/strings/string_refinement/union_find_replace.cpp \ - util/allocate_objects.cpp \ util/cmdline.cpp \ util/dense_integer_map.cpp \ util/edit_distance.cpp \ diff --git a/unit/util/allocate_objects.cpp b/unit/goto-programs/allocate_objects.cpp similarity index 88% rename from unit/util/allocate_objects.cpp rename to unit/goto-programs/allocate_objects.cpp index e619e41e4e2..314ebf32137 100644 --- a/unit/util/allocate_objects.cpp +++ b/unit/goto-programs/allocate_objects.cpp @@ -6,16 +6,16 @@ Author: Diffblue Ltd \*******************************************************************/ -#include +#include + #include -#include #include #include TEST_CASE( "Tests the absence of a bug that crashed allocate_objects", - "[core][util][allocate_objects]") + "[core][goto-programs][allocate_objects]") { symbol_tablet symtab{}; // Because __a_temp will return a const reference to temporary