Skip to content

Commit 6e2b157

Browse files
committed
move pointer-related expression classes into separate header file
std_expr.h is by far the largest header file, which impedes on readability. This commit moves the pointer-related expression classes into a separate header file, following the pattern in mathematical_expr.h.
1 parent 5df251d commit 6e2b157

File tree

118 files changed

+682
-512
lines changed

Some content is hidden

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

118 files changed

+682
-512
lines changed

jbmc/src/java_bytecode/create_array_with_type_intrinsic.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,12 @@ Author: Diffblue Ltd.
1212
#include "create_array_with_type_intrinsic.h"
1313

1414
#include <goto-programs/class_identifier.h>
15+
1516
#include <java_bytecode/java_types.h>
17+
1618
#include <util/fresh_symbol.h>
1719
#include <util/namespace.h>
20+
#include <util/pointer_expr.h>
1821
#include <util/symbol_table_base.h>
1922

2023
/// Returns the symbol name for `org.cprover.CProver.createArrayWithType`

jbmc/src/java_bytecode/java_pointer_casts.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@ Author: Daniel Kroening, [email protected]
1111

1212
#include "java_pointer_casts.h"
1313

14+
#include <util/namespace.h>
15+
#include <util/pointer_expr.h>
1416
#include <util/std_expr.h>
1517
#include <util/std_types.h>
16-
#include <util/namespace.h>
1718

1819
#include "java_types.h"
1920

jbmc/src/java_bytecode/java_trace_validation.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@ Author: Jeannie Moulton
1111
#include <algorithm>
1212

1313
#include <goto-programs/goto_trace.h>
14+
1415
#include <util/byte_operators.h>
1516
#include <util/expr.h>
1617
#include <util/expr_util.h>
18+
#include <util/pointer_expr.h>
1719
#include <util/simplify_expr.h>
1820
#include <util/std_expr.h>
1921

jbmc/src/java_bytecode/java_utils.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Author: Daniel Kroening, [email protected]
1616
#include <util/message.h>
1717
#include <util/nodiscard.h>
1818
#include <util/optional.h>
19+
#include <util/pointer_expr.h>
1920
#include <util/std_expr.h>
2021
#include <util/symbol_table.h>
2122

jbmc/unit/java-testing-utils/require_goto_statements.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,18 @@ Author: Diffblue Ltd.
1010

1111
#include <testing-utils/use_catch.h>
1212

13-
#include <algorithm>
1413
#include <goto-programs/goto_functions.h>
1514
#include <goto-programs/show_goto_functions.h>
15+
1616
#include <java_bytecode/java_types.h>
17+
1718
#include <util/expr_iterator.h>
1819
#include <util/expr_util.h>
20+
#include <util/pointer_expr.h>
1921
#include <util/suffix.h>
2022

23+
#include <algorithm>
24+
2125
/// Expand value of a function to include all child codets
2226
/// \param function_value: The value of the function (e.g. got by looking up
2327
/// the function in the symbol table and getting the value)

jbmc/unit/java_bytecode/java_trace_validation/java_trace_validation.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,15 @@ Author: Diffblue Ltd.
77
\*******************************************************************/
88

99
#include <goto-programs/goto_trace.h>
10+
1011
#include <java_bytecode/java_trace_validation.h>
1112
#include <java_bytecode/java_types.h>
13+
1214
#include <testing-utils/message.h>
1315
#include <testing-utils/use_catch.h>
16+
1417
#include <util/byte_operators.h>
18+
#include <util/pointer_expr.h>
1519

1620
TEST_CASE("java trace validation", "[core][java_trace_validation]")
1721
{

jbmc/unit/pointer-analysis/custom_value_set_analysis.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Author: Chris Smowton, [email protected]
2323
#include <util/config.h>
2424
#include <util/expr_util.h>
2525
#include <util/options.h>
26+
#include <util/pointer_expr.h>
2627

2728
/// An example customised value_sett. It makes a series of small changes
2829
/// to the underlying value_sett logic, which can then be verified by the

jbmc/unit/solvers/strings/string_constraint_instantiation/instantiate_not_contains.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ Author: Jesse Sigal, [email protected]
1111

1212
#include <java_bytecode/java_bytecode_language.h>
1313
#include <java_bytecode/java_types.h>
14-
#include <numeric>
1514

1615
#include <langapi/language_util.h>
1716
#include <langapi/mode.h>
@@ -22,8 +21,11 @@ Author: Jesse Sigal, [email protected]
2221
#include <util/config.h>
2322
#include <util/mathematical_expr.h>
2423
#include <util/mathematical_types.h>
24+
#include <util/pointer_expr.h>
2525
#include <util/simplify_expr.h>
2626

27+
#include <numeric>
28+
2729
/// \class Types used throughout the test. Currently it is impossible to
2830
/// statically initialize this value, there is a PR to allow this
2931
/// diffblue/cbmc/pull/1213

scripts/expected_doxygen_warnings.txt

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,19 +83,20 @@ warning: Include graph for 'cbmc_parse_options.cpp' not generated, too many node
8383
warning: Include graph for 'goto_instrument_parse_options.cpp' not generated, too many nodes (97), threshold is 60. Consider increasing DOT_GRAPH_MAX_NODES.
8484
warning: Included by graph for 'goto_functions.h' not generated, too many nodes (66), threshold is 60. Consider increasing DOT_GRAPH_MAX_NODES.
8585
warning: Included by graph for 'goto_model.h' not generated, too many nodes (109), threshold is 60. Consider increasing DOT_GRAPH_MAX_NODES.
86-
warning: Included by graph for 'arith_tools.h' not generated, too many nodes (182), threshold is 60. Consider increasing DOT_GRAPH_MAX_NODES.
87-
warning: Included by graph for 'c_types.h' not generated, too many nodes (110), threshold is 60. Consider increasing DOT_GRAPH_MAX_NODES.
86+
warning: Included by graph for 'arith_tools.h' not generated, too many nodes (183), threshold is 60. Consider increasing DOT_GRAPH_MAX_NODES.
87+
warning: Included by graph for 'c_types.h' not generated, too many nodes (111), threshold is 60. Consider increasing DOT_GRAPH_MAX_NODES.
8888
warning: Included by graph for 'config.h' not generated, too many nodes (85), threshold is 60. Consider increasing DOT_GRAPH_MAX_NODES.
8989
warning: Included by graph for 'exception_utils.h' not generated, too many nodes (61), threshold is 60. Consider increasing DOT_GRAPH_MAX_NODES.
9090
warning: Included by graph for 'expr.h' not generated, too many nodes (88), threshold is 60. Consider increasing DOT_GRAPH_MAX_NODES.
91-
warning: Included by graph for 'expr_util.h' not generated, too many nodes (60), threshold is 60. Consider increasing DOT_GRAPH_MAX_NODES.
91+
warning: Included by graph for 'expr_util.h' not generated, too many nodes (61), threshold is 60. Consider increasing DOT_GRAPH_MAX_NODES.
9292
warning: Included by graph for 'invariant.h' not generated, too many nodes (187), threshold is 60. Consider increasing DOT_GRAPH_MAX_NODES.
9393
warning: Included by graph for 'irep.h' not generated, too many nodes (62), threshold is 60. Consider increasing DOT_GRAPH_MAX_NODES.
9494
warning: Included by graph for 'message.h' not generated, too many nodes (116), threshold is 60. Consider increasing DOT_GRAPH_MAX_NODES.
95-
warning: Included by graph for 'namespace.h' not generated, too many nodes (112), threshold is 60. Consider increasing DOT_GRAPH_MAX_NODES.
95+
warning: Included by graph for 'namespace.h' not generated, too many nodes (113), threshold is 60. Consider increasing DOT_GRAPH_MAX_NODES.
96+
warning: Included by graph for 'pointer_expr.h' not generated, too many nodes (101), threshold is 60. Consider increasing DOT_GRAPH_MAX_NODES.
9697
warning: Included by graph for 'prefix.h' not generated, too many nodes (86), threshold is 60. Consider increasing DOT_GRAPH_MAX_NODES.
97-
warning: Included by graph for 'simplify_expr.h' not generated, too many nodes (76), threshold is 60. Consider increasing DOT_GRAPH_MAX_NODES.
98+
warning: Included by graph for 'simplify_expr.h' not generated, too many nodes (77), threshold is 60. Consider increasing DOT_GRAPH_MAX_NODES.
9899
warning: Included by graph for 'std_code.h' not generated, too many nodes (78), threshold is 60. Consider increasing DOT_GRAPH_MAX_NODES.
99-
warning: Included by graph for 'std_expr.h' not generated, too many nodes (249), threshold is 60. Consider increasing DOT_GRAPH_MAX_NODES.
100+
warning: Included by graph for 'std_expr.h' not generated, too many nodes (248), threshold is 60. Consider increasing DOT_GRAPH_MAX_NODES.
100101
warning: Included by graph for 'std_types.h' not generated, too many nodes (124), threshold is 60. Consider increasing DOT_GRAPH_MAX_NODES.
101102
warning: Included by graph for 'symbol_table.h' not generated, too many nodes (95), threshold is 60. Consider increasing DOT_GRAPH_MAX_NODES.

src/analyses/ai_domain.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Author: Daniel Kroening, [email protected]
1111

1212
#include "ai_domain.h"
1313

14+
#include <util/pointer_expr.h>
1415
#include <util/simplify_expr.h>
1516

1617
jsont ai_domain_baset::output_json(const ai_baset &ai, const namespacet &ns)

src/analyses/custom_bitvector_analysis.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Author: Daniel Kroening, [email protected]
1212
#include "custom_bitvector_analysis.h"
1313

1414
#include <util/expr_util.h>
15+
#include <util/pointer_expr.h>
1516
#include <util/simplify_expr.h>
1617
#include <util/string_constant.h>
1718
#include <util/xml_irep.h>

src/analyses/dirty.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Date: March 2013
1313

1414
#include "dirty.h"
1515

16+
#include <util/pointer_expr.h>
1617
#include <util/std_expr.h>
1718

1819
void dirtyt::build(const goto_functiont &goto_function)

src/analyses/escape_analysis.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Author: Daniel Kroening, [email protected]
1212
#include "escape_analysis.h"
1313

1414
#include <util/cprover_prefix.h>
15+
#include <util/pointer_expr.h>
1516
#include <util/simplify_expr.h>
1617

1718
bool escape_domaint::is_tracked(const symbol_exprt &symbol)

src/analyses/flow_insensitive_analysis.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Author: Daniel Kroening, [email protected]
1313
#include "flow_insensitive_analysis.h"
1414

1515
#include <util/expr_util.h>
16+
#include <util/pointer_expr.h>
1617
#include <util/std_code.h>
1718
#include <util/std_expr.h>
1819

src/analyses/global_may_alias.cpp

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

1212
#include "global_may_alias.h"
1313

14+
#include <util/pointer_expr.h>
15+
1416
/// Populate list of aliases for a given identifier in a context in
1517
/// which an object is being written to.
1618
/// \param lhs: A left hand side expression, containing an identifier.

src/analyses/goto_check.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ Author: Daniel Kroening, [email protected]
2626
#include <util/invariant.h>
2727
#include <util/make_unique.h>
2828
#include <util/options.h>
29+
#include <util/pointer_expr.h>
2930
#include <util/pointer_offset_size.h>
3031
#include <util/pointer_predicates.h>
3132
#include <util/prefix.h>

src/analyses/goto_rw.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Date: April 2010
2020
#include <util/endianness_map.h>
2121
#include <util/expr_util.h>
2222
#include <util/make_unique.h>
23+
#include <util/pointer_expr.h>
2324
#include <util/pointer_offset_size.h>
2425
#include <util/simplify_expr.h>
2526
#include <util/std_code.h>

src/analyses/invariant_set.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Author: Daniel Kroening, [email protected]
1919
#include <util/c_types.h>
2020
#include <util/expr_util.h>
2121
#include <util/namespace.h>
22+
#include <util/pointer_expr.h>
2223
#include <util/simplify_expr.h>
2324
#include <util/std_expr.h>
2425
#include <util/std_types.h>

src/analyses/local_bitvector_analysis.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@ Author: Daniel Kroening, [email protected]
1414
#include <iterator>
1515
#include <algorithm>
1616

17-
#include <util/std_expr.h>
18-
#include <util/std_code.h>
17+
#include <util/c_types.h>
1918
#include <util/expr_util.h>
19+
#include <util/pointer_expr.h>
20+
#include <util/std_code.h>
21+
#include <util/std_expr.h>
2022

21-
#include <util/c_types.h>
2223
#include <langapi/language_util.h>
2324

2425
void local_bitvector_analysist::flagst::print(std::ostream &out) const

src/analyses/local_may_alias.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ Author: Daniel Kroening, [email protected]
1515
#include <algorithm>
1616

1717
#include <util/arith_tools.h>
18-
#include <util/std_expr.h>
18+
#include <util/pointer_expr.h>
1919
#include <util/std_code.h>
20+
#include <util/std_expr.h>
2021

2122
#include <util/c_types.h>
2223
#include <langapi/language_util.h>

src/analyses/local_safe_pointers.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ Author: Diffblue Ltd
1313
#define CPROVER_ANALYSES_LOCAL_SAFE_POINTERS_H
1414

1515
#include <goto-programs/goto_program.h>
16+
17+
#include <util/pointer_expr.h>
1618
#include <util/std_expr.h>
1719

1820
/// A very simple, cheap analysis to determine when dereference operations are

src/analyses/static_analysis.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Author: Daniel Kroening, [email protected]
1515
#include <memory>
1616

1717
#include <util/expr_util.h>
18+
#include <util/pointer_expr.h>
1819
#include <util/std_code.h>
1920
#include <util/std_expr.h>
2021

src/analyses/variable-sensitivity/abstract_enviroment.cpp

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@
55
Author: Thomas Kiley, [email protected]
66
77
\*******************************************************************/
8-
#include <algorithm>
9-
#include <functional>
10-
#include <map>
11-
#include <ostream>
12-
#include <stack>
8+
9+
#include "abstract_enviroment.h"
10+
11+
#include "abstract_object_statistics.h"
1312

1413
#include <analyses/ai.h>
1514
#include <analyses/variable-sensitivity/abstract_object.h>
@@ -18,10 +17,15 @@
1817
#include <analyses/variable-sensitivity/pointer_abstract_object.h>
1918
#include <analyses/variable-sensitivity/struct_abstract_object.h>
2019
#include <analyses/variable-sensitivity/variable_sensitivity_object_factory.h>
20+
21+
#include <util/pointer_expr.h>
2122
#include <util/simplify_expr.h>
2223

23-
#include "abstract_enviroment.h"
24-
#include "abstract_object_statistics.h"
24+
#include <algorithm>
25+
#include <functional>
26+
#include <map>
27+
#include <ostream>
28+
#include <stack>
2529

2630
#ifdef DEBUG
2731
# include <iostream>

src/analyses/variable-sensitivity/constant_pointer_abstract_object.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,17 @@
66
77
\*******************************************************************/
88

9-
#include <ostream>
10-
119
#include "constant_pointer_abstract_object.h"
10+
1211
#include <analyses/ai.h>
1312
#include <analyses/variable-sensitivity/abstract_enviroment.h>
13+
14+
#include <util/pointer_expr.h>
1415
#include <util/std_expr.h>
1516
#include <util/std_types.h>
1617

18+
#include <ostream>
19+
1720
constant_pointer_abstract_objectt::constant_pointer_abstract_objectt(
1821
const typet &type)
1922
: pointer_abstract_objectt(type)

src/analyses/variable-sensitivity/write_stack.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
#include <util/arith_tools.h>
1818
#include <util/c_types.h>
19+
#include <util/pointer_expr.h>
1920
#include <util/simplify_expr.h>
2021
#include <util/std_expr.h>
2122

src/ansi-c/ansi_c_entry_point.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Author: Daniel Kroening, [email protected]
1111
#include <util/arith_tools.h>
1212
#include <util/c_types.h>
1313
#include <util/config.h>
14+
#include <util/pointer_expr.h>
1415
#include <util/string_constant.h>
1516

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

src/ansi-c/c_typecast.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Author: Daniel Kroening, [email protected]
1515
#include <util/config.h>
1616
#include <util/expr_util.h>
1717
#include <util/mathematical_types.h>
18+
#include <util/pointer_expr.h>
1819
#include <util/simplify_expr.h>
1920
#include <util/std_expr.h>
2021
#include <util/symbol.h>

src/ansi-c/c_typecheck_expr.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Author: Daniel Kroening, [email protected]
2222
#include <util/ieee_float.h>
2323
#include <util/mathematical_expr.h>
2424
#include <util/mathematical_types.h>
25+
#include <util/pointer_expr.h>
2526
#include <util/pointer_offset_size.h>
2627
#include <util/pointer_predicates.h>
2728
#include <util/prefix.h>

src/ansi-c/c_typecheck_gcc_polymorphic_builtins.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Author: Daniel Kroening, [email protected]
1414
#include <util/arith_tools.h>
1515
#include <util/c_types.h>
1616
#include <util/cprover_prefix.h>
17+
#include <util/pointer_expr.h>
1718
#include <util/std_types.h>
1819
#include <util/string_constant.h>
1920

src/ansi-c/c_typecheck_type.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Author: Daniel Kroening, [email protected]
1818
#include <util/config.h>
1919
#include <util/fresh_symbol.h>
2020
#include <util/mathematical_types.h>
21+
#include <util/pointer_expr.h>
2122
#include <util/pointer_offset_size.h>
2223
#include <util/simplify_expr.h>
2324

src/ansi-c/expr2c.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Author: Daniel Kroening, [email protected]
2323
#include <util/lispexpr.h>
2424
#include <util/lispirep.h>
2525
#include <util/namespace.h>
26+
#include <util/pointer_expr.h>
2627
#include <util/pointer_offset_size.h>
2728
#include <util/pointer_predicates.h>
2829
#include <util/prefix.h>

src/assembler/remove_asm.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Date: December 2014
1616
#include "remove_asm.h"
1717

1818
#include <util/c_types.h>
19+
#include <util/pointer_expr.h>
1920
#include <util/string_constant.h>
2021

2122
#include <goto-programs/goto_model.h>

src/cpp/cpp_constructor.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ Author: Daniel Kroening, [email protected]
1212
#include "cpp_typecheck.h"
1313

1414
#include <util/arith_tools.h>
15-
#include <util/std_types.h>
16-
1715
#include <util/c_types.h>
16+
#include <util/pointer_expr.h>
17+
#include <util/std_types.h>
1818

1919
#include "cpp_util.h"
2020

src/cpp/cpp_typecheck_code.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Author: Daniel Kroening, [email protected]
1212
#include "cpp_typecheck.h"
1313

1414
#include <util/arith_tools.h>
15+
#include <util/pointer_expr.h>
1516
#include <util/source_location.h>
1617

1718
#include "cpp_convert_type.h"

src/cpp/cpp_typecheck_constructor.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Author: Daniel Kroening, [email protected]
1212
#include "cpp_typecheck.h"
1313

1414
#include <util/arith_tools.h>
15+
#include <util/pointer_expr.h>
1516
#include <util/std_code.h>
1617
#include <util/std_expr.h>
1718

0 commit comments

Comments
 (0)