Skip to content

Commit a0eff20

Browse files
committed
move goto_convert from goto-programs/ to ansi-c/
The goto_convertt class and associated helpers convert a C parse tree into a set of GOTO functions. They are specific to C, and hence, should be in the ansi-c/ directory.
1 parent e8ff03a commit a0eff20

File tree

64 files changed

+97
-87
lines changed

Some content is hidden

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

64 files changed

+97
-87
lines changed

src/ansi-c/Makefile

+16-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
SRC = anonymous_member.cpp \
1+
SRC = allocate_objects.cpp \
2+
anonymous_member.cpp \
23
ansi_c_convert_type.cpp \
34
ansi_c_declaration.cpp \
45
ansi_c_entry_point.cpp \
@@ -11,6 +12,10 @@ SRC = anonymous_member.cpp \
1112
ansi_c_typecheck.cpp \
1213
ansi_c_y.tab.cpp \
1314
builtin_factory.cpp \
15+
builtin_functions.cpp \
16+
format_strings.cpp \
17+
printf_formatter.cpp \
18+
string_instrumentation.cpp \
1419
c_expr.cpp \
1520
c_misc.cpp \
1621
c_nondet_symbol_factory.cpp \
@@ -32,7 +37,17 @@ SRC = anonymous_member.cpp \
3237
expr2c.cpp \
3338
gcc_types.cpp \
3439
gcc_version.cpp \
40+
goto_asm.cpp \
41+
destructor.cpp \
42+
goto_convert.cpp \
3543
goto_check_c.cpp \
44+
goto_convert_exceptions.cpp \
45+
goto_clean_expr.cpp \
46+
goto_convert_functions.cpp \
47+
goto_convert_function_call.cpp \
48+
goto_convert_side_effect.cpp \
49+
link_to_library.cpp \
50+
scope_tree.cpp \
3651
literals/convert_character_literal.cpp \
3752
literals/convert_float_literal.cpp \
3853
literals/convert_integer_literal.cpp \

src/goto-programs/allocate_objects.cpp renamed to src/ansi-c/allocate_objects.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Author: Daniel Kroening, [email protected]
1414
#include <util/pointer_offset_size.h>
1515
#include <util/symbol.h>
1616

17-
#include "goto_instruction_code.h"
17+
#include <goto-programs/goto_instruction_code.h>
1818

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

src/goto-programs/allocate_objects.h renamed to src/ansi-c/allocate_objects.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ Author: Daniel Kroening, [email protected]
66
77
\*******************************************************************/
88

9-
#ifndef CPROVER_UTIL_ALLOCATE_OBJECTS_H
10-
#define CPROVER_UTIL_ALLOCATE_OBJECTS_H
9+
#ifndef CPROVER_ANSI_C_ALLOCATE_OBJECTS_H
10+
#define CPROVER_ANSI_C_ALLOCATE_OBJECTS_H
1111

1212
#include <util/namespace.h>
1313
#include <util/std_code.h>

src/ansi-c/c_nondet_symbol_factory.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ Author: Diffblue Ltd.
2020
#include <util/std_expr.h>
2121
#include <util/symbol.h>
2222

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

26-
#include <ansi-c/c_object_factory_parameters.h>
25+
#include "allocate_objects.h"
26+
#include "c_object_factory_parameters.h"
2727

2828
/// Creates a nondet for expr, including calling itself recursively to make
2929
/// appropriate symbols to point to if expr is a pointer.

src/ansi-c/c_nondet_symbol_factory.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Author: Diffblue Ltd.
1414

1515
#include <set>
1616

17-
#include <goto-programs/allocate_objects.h>
17+
#include "allocate_objects.h"
1818

1919
struct c_object_factory_parameterst;
2020

src/goto-programs/destructor.cpp renamed to src/ansi-c/destructor.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Author: Daniel Kroening, [email protected]
1010
/// Destructor Calls
1111

1212
#include "destructor.h"
13-
#include "goto_instruction_code.h"
13+
#include <goto-programs/goto_instruction_code.h>
1414

1515
#include <util/namespace.h>
1616
#include <util/pointer_expr.h>

src/goto-programs/destructor.h renamed to src/ansi-c/destructor.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ Author: Daniel Kroening, [email protected]
99
/// \file
1010
/// Destructor Calls
1111

12-
#ifndef CPROVER_GOTO_PROGRAMS_DESTRUCTOR_H
13-
#define CPROVER_GOTO_PROGRAMS_DESTRUCTOR_H
12+
#ifndef CPROVER_ANSI_C_DESTRUCTOR_H
13+
#define CPROVER_ANSI_C_DESTRUCTOR_H
1414

1515
class namespacet;
1616
class typet;
File renamed without changes.

src/goto-programs/format_strings.h renamed to src/ansi-c/format_strings.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ Author: CM Wintersteiger
99
/// \file
1010
/// Format String Parser
1111

12-
#ifndef CPROVER_GOTO_PROGRAMS_FORMAT_STRINGS_H
13-
#define CPROVER_GOTO_PROGRAMS_FORMAT_STRINGS_H
12+
#ifndef CPROVER_ANSI_C_FORMAT_STRINGS_H
13+
#define CPROVER_ANSI_C_FORMAT_STRINGS_H
1414

1515
#include <util/irep.h>
1616
#include <util/mp_arith.h>
File renamed without changes.

src/goto-programs/goto_convert.cpp renamed to src/ansi-c/goto_convert.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Author: Daniel Kroening, [email protected]
2525
#include <util/symbol_table_builder.h>
2626

2727
#include "destructor.h"
28-
#include "remove_skip.h"
28+
#include <goto-programs/remove_skip.h>
2929

3030
static bool is_empty(const goto_programt &goto_program)
3131
{

src/goto-programs/goto_convert.h renamed to src/ansi-c/goto_convert.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ Author: Daniel Kroening, [email protected]
99
/// \file
1010
/// Program Transformation
1111

12-
#ifndef CPROVER_GOTO_PROGRAMS_GOTO_CONVERT_H
13-
#define CPROVER_GOTO_PROGRAMS_GOTO_CONVERT_H
12+
#ifndef CPROVER_ANSI_C_GOTO_CONVERT_H
13+
#define CPROVER_ANSI_C_GOTO_CONVERT_H
1414

1515
#include <util/irep.h>
1616

src/goto-programs/goto_convert_class.h renamed to src/ansi-c/goto_convert_class.h

+4-3
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,17 @@ Author: Daniel Kroening, [email protected]
99
/// \file
1010
/// Program Transformation
1111

12-
#ifndef CPROVER_GOTO_PROGRAMS_GOTO_CONVERT_CLASS_H
13-
#define CPROVER_GOTO_PROGRAMS_GOTO_CONVERT_CLASS_H
12+
#ifndef CPROVER_ANSI_C_GOTO_CONVERT_CLASS_H
13+
#define CPROVER_ANSI_C_GOTO_CONVERT_CLASS_H
1414

1515
#include <util/message.h>
1616
#include <util/namespace.h>
1717
#include <util/replace_expr.h>
1818
#include <util/std_code.h>
1919

20+
#include <goto-programs/goto_program.h>
21+
2022
#include "allocate_objects.h"
21-
#include "goto_program.h"
2223
#include "scope_tree.h"
2324

2425
#include <list>

src/goto-programs/goto_convert_functions.cpp renamed to src/ansi-c/goto_convert_functions.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Date: June 2003
1515

1616
#include <linking/static_lifetime_init.h>
1717

18-
#include "goto_model.h"
18+
#include <goto-programs/goto_model.h>
1919

2020
goto_convert_functionst::goto_convert_functionst(
2121
symbol_table_baset &_symbol_table,

src/goto-programs/goto_convert_functions.h renamed to src/ansi-c/goto_convert_functions.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ Date: June 2003
1515
#define CPROVER_GOTO_PROGRAMS_GOTO_CONVERT_FUNCTIONS_H
1616

1717
#include "goto_convert_class.h"
18-
#include "goto_functions.h"
18+
19+
#include <goto-programs/goto_functions.h>
1920

2021
class goto_modelt;
2122

src/goto-programs/link_to_library.cpp renamed to src/ansi-c/link_to_library.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ Author: Daniel Kroening, [email protected]
1313

1414
#include <linking/static_lifetime_init.h>
1515

16-
#include "compute_called_functions.h"
16+
#include <goto-programs/compute_called_functions.h>
1717
#include "goto_convert_functions.h"
18-
#include "goto_model.h"
19-
#include "link_goto_model.h"
18+
#include <goto-programs/goto_model.h>
19+
#include <goto-programs/link_goto_model.h>
2020

2121
/// Try to add \p missing_function from \p library to \p goto_model.
2222
static std::pair<std::optional<replace_symbolt::expr_mapt>, bool>

src/goto-programs/link_to_library.h renamed to src/ansi-c/link_to_library.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ Author: Daniel Kroening, [email protected]
99
/// \file
1010
/// Library Linking
1111

12-
#ifndef CPROVER_GOTO_PROGRAMS_LINK_TO_LIBRARY_H
13-
#define CPROVER_GOTO_PROGRAMS_LINK_TO_LIBRARY_H
12+
#ifndef CPROVER_ANSI_C_LINK_TO_LIBRARY_H
13+
#define CPROVER_ANSI_C_LINK_TO_LIBRARY_H
1414

1515
#include <functional>
1616
#include <set>

src/goto-programs/printf_formatter.h renamed to src/ansi-c/printf_formatter.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ Author: Daniel Kroening, [email protected]
99
/// \file
1010
/// printf Formatting
1111

12-
#ifndef CPROVER_GOTO_PROGRAMS_PRINTF_FORMATTER_H
13-
#define CPROVER_GOTO_PROGRAMS_PRINTF_FORMATTER_H
12+
#ifndef CPROVER_ANSI_C_PRINTF_FORMATTER_H
13+
#define CPROVER_ANSI_C_PRINTF_FORMATTER_H
1414

1515
#include <util/expr.h>
1616

File renamed without changes.

src/goto-programs/scope_tree.h renamed to src/ansi-c/scope_tree.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
77
\*******************************************************************/
88

9-
#ifndef CPROVER_GOTO_PROGRAMS_DESTRUCTOR_TREE_H
10-
#define CPROVER_GOTO_PROGRAMS_DESTRUCTOR_TREE_H
9+
#ifndef CPROVER_ANSI_C_DESTRUCTOR_TREE_H
10+
#define CPROVER_ANSI_C_DESTRUCTOR_TREE_H
1111

1212
#include <util/graph.h>
1313
#include <util/std_code_base.h>

src/goto-programs/string_instrumentation.cpp renamed to src/ansi-c/string_instrumentation.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Author: Daniel Kroening, [email protected]
2020
#include <util/std_code.h>
2121
#include <util/string_constant.h>
2222

23-
#include <goto-programs/format_strings.h>
23+
#include "format_strings.h"
2424
#include <goto-programs/goto_model.h>
2525
#include <goto-programs/remove_skip.h>
2626

src/goto-programs/string_instrumentation.h renamed to src/ansi-c/string_instrumentation.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ Author: Daniel Kroening, [email protected]
99
/// \file
1010
/// String Abstraction
1111

12-
#ifndef CPROVER_GOTO_PROGRAMS_STRING_INSTRUMENTATION_H
13-
#define CPROVER_GOTO_PROGRAMS_STRING_INSTRUMENTATION_H
12+
#ifndef CPROVER_ANSI_C_STRING_INSTRUMENTATION_H
13+
#define CPROVER_ANSI_C_STRING_INSTRUMENTATION_H
1414

1515
class exprt;
1616
class goto_functionst;

src/cbmc/cbmc_parse_options.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Author: Daniel Kroening, [email protected]
1919
#include <util/version.h>
2020

2121
#include <goto-programs/initialize_goto_model.h>
22-
#include <goto-programs/link_to_library.h>
22+
#include <ansi-c/link_to_library.h>
2323
#include <goto-programs/loop_ids.h>
2424
#include <goto-programs/process_goto_program.h>
2525
#include <goto-programs/read_goto_binary.h>

src/goto-analyzer/goto_analyzer_parse_options.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Author: Daniel Kroening, [email protected]
1919
#include <util/version.h>
2020

2121
#include <goto-programs/initialize_goto_model.h>
22-
#include <goto-programs/link_to_library.h>
22+
#include <ansi-c/link_to_library.h>
2323
#include <goto-programs/process_goto_program.h>
2424
#include <goto-programs/set_properties.h>
2525
#include <goto-programs/show_properties.h>

src/goto-cc/compile.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Date: June 2006
2323
#include <util/unicode.h>
2424
#include <util/version.h>
2525

26-
#include <goto-programs/goto_convert_functions.h>
26+
#include <ansi-c/goto_convert_functions.h>
2727
#include <goto-programs/name_mangler.h>
2828
#include <goto-programs/read_goto_binary.h>
2929
#include <goto-programs/write_goto_binary.h>

src/goto-cc/linker_script_merge.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ Author: Kareem Khazem <[email protected]>, 2017
1717
#include <util/run.h>
1818
#include <util/tempfile.h>
1919

20-
#include <goto-programs/goto_convert_functions.h>
20+
#include <ansi-c/goto_convert_functions.h>
21+
2122
#include <goto-programs/goto_model.h>
2223
#include <goto-programs/read_goto_binary.h>
2324

src/goto-diff/goto_diff_parse_options.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Author: Peter Schrammel
1818
#include <util/version.h>
1919

2020
#include <goto-programs/initialize_goto_model.h>
21-
#include <goto-programs/link_to_library.h>
21+
#include <ansi-c/link_to_library.h>
2222
#include <goto-programs/loop_ids.h>
2323
#include <goto-programs/process_goto_program.h>
2424
#include <goto-programs/remove_skip.h>

src/goto-harness/function_call_harness_generator.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ Author: Diffblue Ltd.
1616
#include <util/string_utils.h>
1717
#include <util/ui_message.h>
1818

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

2323
#include "function_harness_generator_options.h"

src/goto-harness/memory_snapshot_harness_generator.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Author: Daniel Poetzl
1616
#include <util/string_utils.h>
1717
#include <util/symbol_table.h>
1818

19-
#include <goto-programs/goto_convert_functions.h>
19+
#include <ansi-c/goto_convert_functions.h>
2020
#include <goto-programs/goto_model.h>
2121

2222
#include <json-symtab-language/json_symbol_table.h>

src/goto-instrument/contracts/cfg_info.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Date: June 2022
1515
#ifndef CPROVER_GOTO_INSTRUMENT_CONTRACTS_CFG_INFO_H
1616
#define CPROVER_GOTO_INSTRUMENT_CONTRACTS_CFG_INFO_H
1717

18-
#include <goto-programs/goto_convert_class.h>
18+
#include <ansi-c/goto_convert_class.h>
1919

2020
#include <util/byte_operators.h>
2121
#include <util/expr_cast.h>

src/goto-instrument/contracts/contracts.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Date: February 2016
1414
#ifndef CPROVER_GOTO_INSTRUMENT_CONTRACTS_CONTRACTS_H
1515
#define CPROVER_GOTO_INSTRUMENT_CONTRACTS_CONTRACTS_H
1616

17-
#include <goto-programs/goto_convert_class.h>
17+
#include <ansi-c/goto_convert_class.h>
1818

1919
#include <util/message.h>
2020
#include <util/namespace.h>

src/goto-instrument/contracts/dynamic-frames/dfcc.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,13 @@ Author: Remi Delmas, [email protected]
2323
#include <util/std_expr.h>
2424
#include <util/string_utils.h>
2525

26-
#include <goto-programs/goto_convert_functions.h>
26+
#include <ansi-c/goto_convert_functions.h>
27+
2728
#include <goto-programs/goto_functions.h>
2829
#include <goto-programs/goto_inline.h>
2930
#include <goto-programs/goto_model.h>
3031
#include <goto-programs/initialize_goto_model.h>
31-
#include <goto-programs/link_to_library.h>
32+
#include <ansi-c/link_to_library.h>
3233
#include <goto-programs/remove_skip.h>
3334
#include <goto-programs/remove_unused_functions.h>
3435

src/goto-instrument/contracts/dynamic-frames/dfcc_contract_clauses_codegen.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Date: February 2023
1414
#ifndef CPROVER_GOTO_INSTRUMENT_CONTRACTS_DYNAMIC_FRAMES_DFCC_CONTRACT_CLAUSES_CODEGEN_H
1515
#define CPROVER_GOTO_INSTRUMENT_CONTRACTS_DYNAMIC_FRAMES_DFCC_CONTRACT_CLAUSES_CODEGEN_H
1616

17-
#include <goto-programs/goto_convert_class.h>
17+
#include <ansi-c/goto_convert_class.h>
1818

1919
#include <util/message.h>
2020
#include <util/namespace.h>

src/goto-instrument/contracts/dynamic-frames/dfcc_contract_functions.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Date: August 2022
1414
#ifndef CPROVER_GOTO_INSTRUMENT_CONTRACTS_DYNAMIC_FRAMES_DFCC_CONTRACT_FUNCTIONS_H
1515
#define CPROVER_GOTO_INSTRUMENT_CONTRACTS_DYNAMIC_FRAMES_DFCC_CONTRACT_FUNCTIONS_H
1616

17-
#include <goto-programs/goto_convert_class.h>
17+
#include <ansi-c/goto_convert_class.h>
1818

1919
#include <util/message.h>
2020
#include <util/namespace.h>

src/goto-instrument/contracts/dynamic-frames/dfcc_contract_handler.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Date: August 2022
1313
#ifndef CPROVER_GOTO_INSTRUMENT_CONTRACTS_DYNAMIC_FRAMES_DFCC_CONTRACT_HANDLER_H
1414
#define CPROVER_GOTO_INSTRUMENT_CONTRACTS_DYNAMIC_FRAMES_DFCC_CONTRACT_HANDLER_H
1515

16-
#include <goto-programs/goto_convert_class.h>
16+
#include <ansi-c/goto_convert_class.h>
1717

1818
#include <util/message.h>
1919
#include <util/namespace.h>

src/goto-instrument/contracts/dynamic-frames/dfcc_instrument_loop.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ Date: April 2023
1111
\*******************************************************************/
1212

1313
#include "dfcc_instrument_loop.h"
14-
#include <goto-programs/goto_convert_class.h>
14+
15+
#include <ansi-c/goto_convert_class.h>
1516

1617
#include <util/format_expr.h>
1718
#include <util/fresh_symbol.h>

src/goto-instrument/contracts/dynamic-frames/dfcc_library.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Author: Remi Delmas, [email protected]
1818
#include <util/std_code.h>
1919
#include <util/std_expr.h>
2020

21-
#include <goto-programs/goto_convert_functions.h>
21+
#include <ansi-c/goto_convert_functions.h>
2222
#include <goto-programs/goto_function.h>
2323
#include <goto-programs/goto_model.h>
2424

src/goto-instrument/contracts/dynamic-frames/dfcc_spec_functions.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ Author: Remi Delmas, [email protected]
77
\*******************************************************************/
88

99
#include "dfcc_spec_functions.h"
10-
#include <goto-programs/goto_convert_class.h>
10+
11+
#include <ansi-c/goto_convert_class.h>
1112

1213
#include <util/format_expr.h>
1314
#include <util/namespace.h>

0 commit comments

Comments
 (0)