Skip to content

Commit cab7f30

Browse files
committed
move nondet.h/.cpp and allocate_objects.h/.cpp
This moves allocate_objects.h/.cpp to goto-programs, since it relates to procedural code. nondet.h/.cpp are moved to jbmc, which is where it is used.
1 parent 29ca8a9 commit cab7f30

19 files changed

+35
-31
lines changed

jbmc/src/java_bytecode/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ SRC = assignments_from_json.cpp \
4848
lift_clinit_calls.cpp \
4949
load_method_by_regex.cpp \
5050
mz_zip_archive.cpp \
51+
nondet.cpp \
5152
remove_exceptions.cpp \
5253
remove_instanceof.cpp \
5354
remove_java_new.cpp \

jbmc/src/java_bytecode/assignments_from_json.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ Author: Diffblue Ltd.
1515
#include "java_types.h"
1616
#include "java_utils.h"
1717

18+
#include <goto-programs/allocate_objects.h>
1819
#include <goto-programs/class_identifier.h>
1920

20-
#include <util/allocate_objects.h>
2121
#include <util/arith_tools.h>
2222
#include <util/array_element_from_pointer.h>
2323
#include <util/expr_initializer.h>

jbmc/src/java_bytecode/java_entry_point.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ Author: Daniel Kroening, [email protected]
1111
#include <util/config.h>
1212
#include <util/expr_initializer.h>
1313
#include <util/journalling_symbol_table.h>
14-
#include <util/nondet.h>
1514
#include <util/suffix.h>
1615

1716
#include <goto-programs/adjust_float_expressions.h>
@@ -26,6 +25,7 @@ Author: Daniel Kroening, [email protected]
2625
#include "java_string_literals.h"
2726
#include "java_types.h"
2827
#include "java_utils.h"
28+
#include "nondet.h"
2929

3030
#include <cstring>
3131

jbmc/src/java_bytecode/java_object_factory.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ Author: Daniel Kroening, [email protected]
1212
#include <util/array_element_from_pointer.h>
1313
#include <util/expr_initializer.h>
1414
#include <util/message.h>
15-
#include <util/nondet.h>
1615
#include <util/nondet_bool.h>
1716
#include <util/prefix.h>
1817

jbmc/src/java_bytecode/java_object_factory.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,10 @@ Author: Daniel Kroening, [email protected]
7171
#ifndef CPROVER_JAVA_BYTECODE_JAVA_OBJECT_FACTORY_H
7272
#define CPROVER_JAVA_BYTECODE_JAVA_OBJECT_FACTORY_H
7373

74-
#include <util/allocate_objects.h>
75-
#include <util/nondet.h>
74+
#include "nondet.h"
75+
76+
#include <goto-programs/allocate_objects.h>
77+
7678
#include <util/std_code.h>
7779

7880
class message_handlert;

jbmc/src/java_bytecode/java_string_library_preprocess.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ Date: April 2017
1616
/// java standard library. In particular methods from java.lang.String,
1717
/// java.lang.StringBuilder, java.lang.StringBuffer.
1818

19+
#include <goto-programs/allocate_objects.h>
1920
#include <goto-programs/class_identifier.h>
2021

21-
#include <util/allocate_objects.h>
2222
#include <util/arith_tools.h>
2323
#include <util/bitvector_expr.h>
2424
#include <util/c_types.h>

src/util/nondet.cpp renamed to jbmc/src/java_bytecode/nondet.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ Author: Diffblue Ltd.
88

99
#include "nondet.h"
1010

11-
#include "allocate_objects.h"
12-
#include "arith_tools.h"
11+
#include <goto-programs/allocate_objects.h>
12+
13+
#include <util/arith_tools.h>
1314

1415
symbol_exprt generate_nondet_int(
1516
const exprt &min_value_expr,

src/util/nondet.h renamed to jbmc/src/java_bytecode/nondet.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Author: Diffblue Ltd.
99
#ifndef CPROVER_JAVA_BYTECODE_NONDET_H
1010
#define CPROVER_JAVA_BYTECODE_NONDET_H
1111

12-
#include "std_code.h"
12+
#include <util/std_code.h>
1313

1414
class allocate_objectst;
1515
class symbol_table_baset;

src/ansi-c/c_nondet_symbol_factory.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ Author: Diffblue Ltd.
1313

1414
#include <ansi-c/c_object_factory_parameters.h>
1515

16-
#include <util/allocate_objects.h>
1716
#include <util/arith_tools.h>
1817
#include <util/c_types.h>
1918
#include <util/namespace.h>
2019
#include <util/nondet_bool.h>
2120
#include <util/pointer_expr.h>
2221
#include <util/std_expr.h>
2322

23+
#include <goto-programs/allocate_objects.h>
2424
#include <goto-programs/goto_functions.h>
2525

2626
/// Creates a nondet for expr, including calling itself recursively to make

src/ansi-c/c_nondet_symbol_factory.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ Author: Diffblue Ltd.
1414

1515
#include <set>
1616

17-
#include <util/allocate_objects.h>
17+
#include <goto-programs/allocate_objects.h>
18+
1819
#include <util/symbol_table.h>
1920

2021
struct c_object_factory_parameterst;

src/goto-harness/function_call_harness_generator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ Author: Diffblue Ltd.
88

99
#include "function_call_harness_generator.h"
1010

11-
#include <util/allocate_objects.h>
1211
#include <util/arith_tools.h>
1312
#include <util/c_types.h>
1413
#include <util/exception_utils.h>
@@ -18,6 +17,7 @@ Author: Diffblue Ltd.
1817
#include <util/string_utils.h>
1918
#include <util/ui_message.h>
2019

20+
#include <goto-programs/allocate_objects.h>
2121
#include <goto-programs/goto_convert_functions.h>
2222
#include <goto-programs/goto_model.h>
2323

src/goto-programs/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
SRC = add_malloc_may_fail_variable_initializations.cpp \
1+
SRC = allocate_objects.cpp \
2+
add_malloc_may_fail_variable_initializations.cpp \
23
adjust_float_expressions.cpp \
34
builtin_functions.cpp \
45
class_hierarchy.cpp \

src/util/allocate_objects.cpp renamed to src/goto-programs/allocate_objects.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ Author: Daniel Kroening, [email protected]
88

99
#include "allocate_objects.h"
1010

11-
#include "c_types.h"
12-
#include "fresh_symbol.h"
13-
#include "pointer_expr.h"
14-
#include "pointer_offset_size.h"
15-
#include "symbol.h"
11+
#include <util/c_types.h>
12+
#include <util/fresh_symbol.h>
13+
#include <util/pointer_expr.h>
14+
#include <util/pointer_offset_size.h>
15+
#include <util/symbol.h>
1616

1717
/// Allocates a new object, either by creating a local variable with automatic
1818
/// lifetime, a global variable with static lifetime, or by dynamically

src/util/allocate_objects.h renamed to src/goto-programs/allocate_objects.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ Author: Daniel Kroening, [email protected]
99
#ifndef CPROVER_UTIL_ALLOCATE_OBJECTS_H
1010
#define CPROVER_UTIL_ALLOCATE_OBJECTS_H
1111

12-
#include "goto_instruction_code.h"
13-
#include "namespace.h"
14-
#include "source_location.h"
12+
#include <util/goto_instruction_code.h>
13+
#include <util/namespace.h>
14+
#include <util/source_location.h>
1515

1616
/// Selects the kind of objects allocated
1717
enum class lifetimet

src/goto-programs/goto_convert_class.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ Author: Daniel Kroening, [email protected]
1616
#include <vector>
1717
#include <unordered_set>
1818

19-
#include <util/allocate_objects.h>
2019
#include <util/message.h>
2120
#include <util/namespace.h>
2221
#include <util/replace_expr.h>
2322
#include <util/std_code.h>
2423

25-
#include "goto_program.h"
24+
#include "allocate_objects.h"
2625
#include "destructor_tree.h"
26+
#include "goto_program.h"
2727

2828
class side_effect_expr_overflowt;
2929

src/memory-analyzer/analyze_symbol.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,13 @@ Author: Malte Mues <[email protected]>
2020

2121
#include <ansi-c/expr2c_class.h>
2222

23-
#include <util/allocate_objects.h>
2423
#include <util/message.h>
2524
#include <util/namespace.h>
2625
#include <util/std_code.h>
2726
#include <util/symbol_table.h>
2827

28+
#include <goto-programs/allocate_objects.h>
29+
2930
class gdb_apit;
3031
class exprt;
3132
class source_locationt;

src/util/Makefile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
SRC = allocate_objects.cpp \
2-
arith_tools.cpp \
1+
SRC = arith_tools.cpp \
32
array_element_from_pointer.cpp \
43
array_name.cpp \
54
base_type.cpp \
@@ -54,7 +53,6 @@ SRC = allocate_objects.cpp \
5453
message.cpp \
5554
mp_arith.cpp \
5655
namespace.cpp \
57-
nondet.cpp \
5856
object_factory_parameters.cpp \
5957
options.cpp \
6058
parse_options.cpp \

unit/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ SRC += analyses/ai/ai.cpp \
5959
goto-checker/report_util/is_property_less_than.cpp \
6060
goto-instrument/cover_instrument.cpp \
6161
goto-instrument/cover/cover_only.cpp \
62+
goto-programs/allocate_objects.cpp \
6263
goto-programs/goto_program_assume.cpp \
6364
goto-programs/goto_program_dead.cpp \
6465
goto-programs/goto_program_declaration.cpp \
@@ -118,7 +119,6 @@ SRC += analyses/ai/ai.cpp \
118119
solvers/strings/string_refinement/string_refinement.cpp \
119120
solvers/strings/string_refinement/substitute_array_list.cpp \
120121
solvers/strings/string_refinement/union_find_replace.cpp \
121-
util/allocate_objects.cpp \
122122
util/cmdline.cpp \
123123
util/dense_integer_map.cpp \
124124
util/edit_distance.cpp \

unit/util/allocate_objects.cpp renamed to unit/goto-programs/allocate_objects.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ Author: Diffblue Ltd
66
77
\*******************************************************************/
88

9-
#include <util/allocate_objects.h>
9+
#include <goto-programs/allocate_objects.h>
10+
1011
#include <util/c_types.h>
11-
#include <util/source_location.h>
1212
#include <util/symbol_table.h>
1313

1414
#include <testing-utils/use_catch.h>
1515

1616
TEST_CASE(
1717
"Tests the absence of a bug that crashed allocate_objects",
18-
"[core][util][allocate_objects]")
18+
"[core][goto-programs][allocate_objects]")
1919
{
2020
symbol_tablet symtab{};
2121
// Because __a_temp will return a const reference to temporary

0 commit comments

Comments
 (0)