Skip to content

Commit b3edca6

Browse files
committed
Move {json,xml}_expr.{h,cpp} to goto-programs
There should not be a dependency from util to langapi, and goto-programs is also the only place where {json,xml}_expr are used.
1 parent f295ed8 commit b3edca6

12 files changed

+41
-39
lines changed

src/cbmc/bmc_cover.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,18 @@ Author: Daniel Kroening, [email protected]
1717
#include <goto-checker/bmc_util.h>
1818

1919
#include <util/json.h>
20-
#include <util/json_expr.h>
2120
#include <util/json_stream.h>
22-
#include <util/xml_expr.h>
2321
#include <util/xml_irep.h>
2422

2523
#include <solvers/prop/cover_goals.h>
2624
#include <solvers/prop/literal_expr.h>
2725

2826
#include <goto-symex/build_goto_trace.h>
29-
#include <goto-programs/xml_goto_trace.h>
27+
28+
#include <goto-programs/json_expr.h>
3029
#include <goto-programs/json_goto_trace.h>
30+
#include <goto-programs/xml_expr.h>
31+
#include <goto-programs/xml_goto_trace.h>
3132

3233
#include <langapi/language_util.h>
3334

src/goto-programs/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ SRC = adjust_float_expressions.cpp \
2525
instrument_preconditions.cpp \
2626
interpreter.cpp \
2727
interpreter_evaluate.cpp \
28+
json_expr.cpp \
2829
json_goto_trace.cpp \
2930
lazy_goto_model.cpp \
3031
link_goto_model.cpp \
@@ -67,6 +68,7 @@ SRC = adjust_float_expressions.cpp \
6768
vcd_goto_trace.cpp \
6869
wp.cpp \
6970
write_goto_binary.cpp \
71+
xml_expr.cpp \
7072
xml_goto_trace.cpp \
7173
# Empty last line
7274

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@ Author: Peter Schrammel
1111

1212
#include "json_expr.h"
1313

14-
#include "namespace.h"
15-
#include "expr.h"
16-
#include "json.h"
17-
#include "arith_tools.h"
18-
#include "ieee_float.h"
19-
#include "fixedbv.h"
20-
#include "std_expr.h"
21-
#include "config.h"
22-
#include "identifier.h"
23-
#include "invariant.h"
14+
#include <util/namespace.h>
15+
#include <util/expr.h>
16+
#include <util/json.h>
17+
#include <util/arith_tools.h>
18+
#include <util/ieee_float.h>
19+
#include <util/fixedbv.h>
20+
#include <util/std_expr.h>
21+
#include <util/config.h>
22+
#include <util/identifier.h>
23+
#include <util/invariant.h>
2424

2525
#include <langapi/mode.h>
2626
#include <langapi/language.h>

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ Author: Peter Schrammel
99
/// \file
1010
/// Expressions in JSON
1111

12-
#ifndef CPROVER_UTIL_JSON_EXPR_H
13-
#define CPROVER_UTIL_JSON_EXPR_H
12+
#ifndef CPROVER_GOTO_PROGRAMS_JSON_EXPR_H
13+
#define CPROVER_GOTO_PROGRAMS_JSON_EXPR_H
1414

15-
#include "json.h"
16-
#include "irep.h"
15+
#include <util/json.h>
16+
#include <util/irep.h>
1717

1818
class typet;
1919
class exprt;
@@ -29,4 +29,4 @@ json_objectt json(
2929
const namespacet &,
3030
const irep_idt &mode);
3131

32-
#endif // CPROVER_UTIL_JSON_EXPR_H
32+
#endif // CPROVER_GOTO_PROGRAMS_JSON_EXPR_H

src/goto-programs/json_goto_trace.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,16 @@ Author: Daniel Kroening
1212
/// Traces of GOTO Programs
1313

1414
#include "json_goto_trace.h"
15-
#include "goto_trace.h"
1615

1716
#include <langapi/language_util.h>
1817
#include <util/arith_tools.h>
1918
#include <util/config.h>
2019
#include <util/invariant.h>
21-
#include <util/json_expr.h>
2220
#include <util/simplify_expr.h>
2321

22+
#include "goto_trace.h"
23+
#include "json_expr.h"
24+
2425
/// Convert an ASSERT goto_trace step.
2526
/// \param [out] json_failure: The JSON object that
2627
/// will contain the information about the step

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ Author: Daniel Kroening
1313

1414
#include "xml_expr.h"
1515

16-
#include "arith_tools.h"
17-
#include "config.h"
18-
#include "expr.h"
19-
#include "fixedbv.h"
20-
#include "ieee_float.h"
21-
#include "invariant.h"
22-
#include "namespace.h"
23-
#include "std_expr.h"
24-
#include "xml.h"
16+
#include <util/arith_tools.h>
17+
#include <util/config.h>
18+
#include <util/expr.h>
19+
#include <util/fixedbv.h>
20+
#include <util/ieee_float.h>
21+
#include <util/invariant.h>
22+
#include <util/namespace.h>
23+
#include <util/std_expr.h>
24+
#include <util/xml.h>
2525

2626
xmlt xml(
2727
const typet &type,

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ Author: Daniel Kroening, [email protected]
77
\*******************************************************************/
88

99

10-
#ifndef CPROVER_UTIL_XML_EXPR_H
11-
#define CPROVER_UTIL_XML_EXPR_H
10+
#ifndef CPROVER_GOTO_PROGRAMS_XML_EXPR_H
11+
#define CPROVER_GOTO_PROGRAMS_XML_EXPR_H
1212

13-
#include "xml.h"
13+
#include <util/xml.h>
1414

1515
class typet;
1616
class exprt;
@@ -24,4 +24,4 @@ xmlt xml(
2424
const typet &,
2525
const namespacet &);
2626

27-
#endif // CPROVER_UTIL_XML_EXPR_H
27+
#endif // CPROVER_GOTO_PROGRAMS_XML_EXPR_H

src/goto-programs/xml_goto_trace.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ Author: Daniel Kroening
1616
#include <cassert>
1717

1818
#include <util/symbol.h>
19-
#include <util/xml_expr.h>
2019
#include <util/xml_irep.h>
2120

2221
#include <langapi/language_util.h>
2322

2423
#include "printf_formatter.h"
24+
#include "xml_expr.h"
2525

2626
void convert(
2727
const namespacet &ns,

src/util/Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ SRC = allocate_objects.cpp \
3737
irep_serialization.cpp \
3838
invariant_utils.cpp \
3939
json.cpp \
40-
json_expr.cpp \
4140
json_irep.cpp \
4241
json_stream.cpp \
4342
lispexpr.cpp \
@@ -103,7 +102,6 @@ SRC = allocate_objects.cpp \
103102
validate_types.cpp \
104103
version.cpp \
105104
xml.cpp \
106-
xml_expr.cpp \
107105
xml_irep.cpp \
108106
# Empty last line
109107

src/util/module_dependencies.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
big-int
2-
langapi # should go away
32
mach # system
43
malloc # system
54
nonstd

unit/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ SRC += analyses/ai/ai.cpp \
2525
goto-programs/goto_program_symbol_type_table_consistency.cpp \
2626
goto-programs/goto_program_table_consistency.cpp \
2727
goto-programs/goto_trace_output.cpp \
28+
goto-programs/xml_expr.cpp \
2829
goto-symex/ssa_equation.cpp \
2930
interpreter/interpreter.cpp \
3031
json/json_parser.cpp \
@@ -68,7 +69,6 @@ SRC += analyses/ai/ai.cpp \
6869
util/symbol_table.cpp \
6970
util/symbol.cpp \
7071
util/unicode.cpp \
71-
util/xml_expr.cpp \
7272
# Empty last line
7373

7474
INCLUDES= -I ../src/ -I.

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ Author: Michael Tautschnig
1313
#include <util/namespace.h>
1414
#include <util/std_expr.h>
1515
#include <util/symbol_table.h>
16-
#include <util/xml_expr.h>
16+
17+
#include <goto-programs/xml_expr.h>
1718

1819
TEST_CASE("Constant expression to XML")
1920
{

0 commit comments

Comments
 (0)