Skip to content

Commit 2526b66

Browse files
Move INITIALIZE_FUNCTION macro to goto-programs to reduce linking dependency
The INITIALIZE_FUNCTION macro was defined in linking/static_lifetime_init.h, causing 22 files across the codebase to include this header solely to access this string constant. This translated to an otherwise-unnecessary dependency on the linking module. Move the macro definition to a new header goto-programs/initialize_function.h, which is a more fundamental module. Co-authored-by: Kiro <[email protected]>
1 parent 1690ff0 commit 2526b66

28 files changed

+57
-52
lines changed

src/ansi-c/ansi_c_internal_additions.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ Author: Daniel Kroening, [email protected]
1212
#include <util/config.h>
1313

1414
#include <goto-programs/adjust_float_expressions.h>
15-
16-
#include <linking/static_lifetime_init.h>
15+
#include <goto-programs/initialize_function.h>
1716

1817
#include "ansi_c_parser.h"
1918

src/ansi-c/goto-conversion/goto_convert_functions.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ Date: June 2003
1414
#include <util/symbol_table_builder.h>
1515

1616
#include <goto-programs/goto_model.h>
17-
18-
#include <linking/static_lifetime_init.h>
17+
#include <goto-programs/initialize_function.h>
1918

2019
goto_convert_functionst::goto_convert_functionst(
2120
symbol_table_baset &_symbol_table,

src/cpp/cpp_internal_additions.cpp

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

99
#include "cpp_internal_additions.h"
1010

11-
#include <ostream>
12-
1311
#include <util/c_types.h>
1412
#include <util/config.h>
1513

16-
#include <ansi-c/ansi_c_internal_additions.h>
14+
#include <goto-programs/adjust_float_expressions.h>
15+
#include <goto-programs/initialize_function.h>
1716

18-
#include <linking/static_lifetime_init.h>
17+
#include <ansi-c/ansi_c_internal_additions.h>
1918

20-
#include <goto-programs/adjust_float_expressions.h>
19+
#include <ostream>
2120

2221
std::string c2cpp(const std::string &s)
2322
{

src/goto-cc/compile.cpp

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

26+
#include <goto-programs/initialize_function.h>
2627
#include <goto-programs/name_mangler.h>
2728
#include <goto-programs/read_goto_binary.h>
2829
#include <goto-programs/write_goto_binary.h>
@@ -34,7 +35,6 @@ Date: June 2006
3435
#include <langapi/language_file.h>
3536
#include <langapi/mode.h>
3637
#include <linking/linking.h>
37-
#include <linking/static_lifetime_init.h>
3838

3939
#include <cstring>
4040
#include <filesystem>

src/goto-checker/module_dependencies.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,5 @@ goto-checker
33
goto-programs
44
goto-symex
55
langapi
6-
linking
76
solvers
87
util

src/goto-checker/symex_bmc.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,9 @@ Author: Daniel Kroening, [email protected]
1414
#include <util/simplify_expr.h>
1515
#include <util/source_location.h>
1616

17+
#include <goto-programs/initialize_function.h>
1718
#include <goto-programs/unwindset.h>
1819

19-
#include <linking/static_lifetime_init.h>
20-
2120
#include <limits>
2221

2322
symex_bmct::symex_bmct(

src/goto-checker/symex_coverage.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ Date: March 2016
1919
#include <util/xml.h>
2020

2121
#include <goto-programs/goto_functions.h>
22+
#include <goto-programs/initialize_function.h>
2223

2324
#include <langapi/language_util.h>
24-
#include <linking/static_lifetime_init.h>
2525

2626
#include <chrono> // IWYU pragma: keep
2727
#include <ctime> // IWYU pragma: keep - For std::time_t

src/goto-instrument/aggressive_slicer.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,9 @@ Author: Elizabeth Polgreen, [email protected]
1414
#include <util/message.h>
1515

1616
#include <goto-programs/goto_model.h>
17+
#include <goto-programs/initialize_function.h>
1718
#include <goto-programs/show_properties.h>
1819

19-
#include <linking/static_lifetime_init.h>
20-
2120
#include <analyses/call_graph_helpers.h>
2221

2322
#include "remove_function.h"

src/goto-instrument/call_sequences.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,15 @@ Date: April 2013
1313

1414
#include "call_sequences.h"
1515

16-
#include <stack>
17-
#include <iostream>
18-
1916
#include <util/simplify_expr.h>
2017

2118
#include <goto-programs/goto_model.h>
19+
#include <goto-programs/initialize_function.h>
2220

2321
#include <langapi/language_util.h>
2422

25-
#include <linking/static_lifetime_init.h>
23+
#include <iostream>
24+
#include <stack>
2625

2726
void show_call_sequences(
2827
const irep_idt &caller,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Author: Remi Delmas, [email protected]
2020

2121
#include <goto-programs/goto_function.h>
2222
#include <goto-programs/goto_model.h>
23+
#include <goto-programs/initialize_function.h>
2324
#include <goto-programs/unwindset.h>
2425

2526
#include <ansi-c/c_expr.h>
@@ -28,7 +29,6 @@ Author: Remi Delmas, [email protected]
2829
#include <ansi-c/goto-conversion/goto_convert_functions.h>
2930
#include <goto-instrument/generate_function_bodies.h>
3031
#include <goto-instrument/unwind.h>
31-
#include <linking/static_lifetime_init.h>
3232

3333
#include "dfcc_utils.h"
3434

0 commit comments

Comments
 (0)