Skip to content

move nondet.h/.cpp and allocate_objects.h/.cpp #6410

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions jbmc/src/java_bytecode/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
2 changes: 1 addition & 1 deletion jbmc/src/java_bytecode/assignments_from_json.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ Author: Diffblue Ltd.
#include "java_types.h"
#include "java_utils.h"

#include <goto-programs/allocate_objects.h>
#include <goto-programs/class_identifier.h>

#include <util/allocate_objects.h>
#include <util/arith_tools.h>
#include <util/array_element_from_pointer.h>
#include <util/expr_initializer.h>
Expand Down
2 changes: 1 addition & 1 deletion jbmc/src/java_bytecode/java_entry_point.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ Author: Daniel Kroening, [email protected]
#include <util/config.h>
#include <util/expr_initializer.h>
#include <util/journalling_symbol_table.h>
#include <util/nondet.h>
#include <util/suffix.h>

#include <goto-programs/adjust_float_expressions.h>
Expand All @@ -26,6 +25,7 @@ Author: Daniel Kroening, [email protected]
#include "java_string_literals.h"
#include "java_types.h"
#include "java_utils.h"
#include "nondet.h"

#include <cstring>

Expand Down
1 change: 0 additions & 1 deletion jbmc/src/java_bytecode/java_object_factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ Author: Daniel Kroening, [email protected]
#include <util/array_element_from_pointer.h>
#include <util/expr_initializer.h>
#include <util/message.h>
#include <util/nondet.h>
#include <util/nondet_bool.h>
#include <util/prefix.h>

Expand Down
6 changes: 4 additions & 2 deletions jbmc/src/java_bytecode/java_object_factory.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,10 @@ Author: Daniel Kroening, [email protected]
#ifndef CPROVER_JAVA_BYTECODE_JAVA_OBJECT_FACTORY_H
#define CPROVER_JAVA_BYTECODE_JAVA_OBJECT_FACTORY_H

#include <util/allocate_objects.h>
#include <util/nondet.h>
#include "nondet.h"

#include <goto-programs/allocate_objects.h>

#include <util/std_code.h>

class message_handlert;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ Date: April 2017
/// java standard library. In particular methods from java.lang.String,
/// java.lang.StringBuilder, java.lang.StringBuffer.

#include <goto-programs/allocate_objects.h>
#include <goto-programs/class_identifier.h>

#include <util/allocate_objects.h>
#include <util/arith_tools.h>
#include <util/bitvector_expr.h>
#include <util/c_types.h>
Expand Down
5 changes: 3 additions & 2 deletions src/util/nondet.cpp → jbmc/src/java_bytecode/nondet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ Author: Diffblue Ltd.

#include "nondet.h"

#include "allocate_objects.h"
#include "arith_tools.h"
#include <goto-programs/allocate_objects.h>

#include <util/arith_tools.h>

symbol_exprt generate_nondet_int(
const exprt &min_value_expr,
Expand Down
2 changes: 1 addition & 1 deletion src/util/nondet.h → jbmc/src/java_bytecode/nondet.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Author: Diffblue Ltd.
#ifndef CPROVER_JAVA_BYTECODE_NONDET_H
#define CPROVER_JAVA_BYTECODE_NONDET_H

#include "std_code.h"
#include <util/std_code.h>

class allocate_objectst;
class symbol_table_baset;
Expand Down
2 changes: 1 addition & 1 deletion src/ansi-c/c_nondet_symbol_factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ Author: Diffblue Ltd.

#include <ansi-c/c_object_factory_parameters.h>

#include <util/allocate_objects.h>
#include <util/arith_tools.h>
#include <util/c_types.h>
#include <util/namespace.h>
#include <util/nondet_bool.h>
#include <util/pointer_expr.h>
#include <util/std_expr.h>

#include <goto-programs/allocate_objects.h>
#include <goto-programs/goto_functions.h>

/// Creates a nondet for expr, including calling itself recursively to make
Expand Down
3 changes: 2 additions & 1 deletion src/ansi-c/c_nondet_symbol_factory.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ Author: Diffblue Ltd.

#include <set>

#include <util/allocate_objects.h>
#include <goto-programs/allocate_objects.h>

#include <util/symbol_table.h>

struct c_object_factory_parameterst;
Expand Down
2 changes: 1 addition & 1 deletion src/goto-harness/function_call_harness_generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ Author: Diffblue Ltd.

#include "function_call_harness_generator.h"

#include <util/allocate_objects.h>
#include <util/arith_tools.h>
#include <util/c_types.h>
#include <util/exception_utils.h>
Expand All @@ -18,6 +17,7 @@ Author: Diffblue Ltd.
#include <util/string_utils.h>
#include <util/ui_message.h>

#include <goto-programs/allocate_objects.h>
#include <goto-programs/goto_convert_functions.h>
#include <goto-programs/goto_model.h>

Expand Down
3 changes: 2 additions & 1 deletion src/goto-programs/Makefile
Original file line number Diff line number Diff line change
@@ -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 \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ Author: Daniel Kroening, [email protected]

#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 <util/c_types.h>
#include <util/fresh_symbol.h>
#include <util/pointer_expr.h>
#include <util/pointer_offset_size.h>
#include <util/symbol.h>

/// Allocates a new object, either by creating a local variable with automatic
/// lifetime, a global variable with static lifetime, or by dynamically
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ Author: Daniel Kroening, [email protected]
#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 <util/goto_instruction_code.h>
#include <util/namespace.h>
#include <util/source_location.h>

/// Selects the kind of objects allocated
enum class lifetimet
Expand Down
4 changes: 2 additions & 2 deletions src/goto-programs/goto_convert_class.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ Author: Daniel Kroening, [email protected]
#include <vector>
#include <unordered_set>

#include <util/allocate_objects.h>
#include <util/message.h>
#include <util/namespace.h>
#include <util/replace_expr.h>
#include <util/std_code.h>

#include "goto_program.h"
#include "allocate_objects.h"
#include "destructor_tree.h"
#include "goto_program.h"

class side_effect_expr_overflowt;

Expand Down
3 changes: 2 additions & 1 deletion src/memory-analyzer/analyze_symbol.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@ Author: Malte Mues <[email protected]>

#include <ansi-c/expr2c_class.h>

#include <util/allocate_objects.h>
#include <util/message.h>
#include <util/namespace.h>
#include <util/std_code.h>
#include <util/symbol_table.h>

#include <goto-programs/allocate_objects.h>

class gdb_apit;
class exprt;
class source_locationt;
Expand Down
4 changes: 1 addition & 3 deletions src/util/Makefile
Original file line number Diff line number Diff line change
@@ -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 \
Expand Down Expand Up @@ -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 \
Expand Down
2 changes: 1 addition & 1 deletion unit/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down Expand Up @@ -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 \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ Author: Diffblue Ltd

\*******************************************************************/

#include <util/allocate_objects.h>
#include <goto-programs/allocate_objects.h>

#include <util/c_types.h>
#include <util/source_location.h>
#include <util/symbol_table.h>

#include <testing-utils/use_catch.h>

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
Expand Down