From 13d86b0808b13c6633de14a170fc8fadbcd5e445 Mon Sep 17 00:00:00 2001 From: Michael Tautschnig Date: Fri, 31 Dec 2021 17:01:02 +0000 Subject: [PATCH] Linking/static lifetime init: do not use goto code types The code in src/linking supposedly deals with symbol tables only, not with goto programs (goto-programs/link_goto_model does this). Consequently, static lifetime init should not create codet structures defined in goto-programs/goto_instruction_code.h. This is a first step to remove the goto-programs dependency from src/linking. --- src/linking/static_lifetime_init.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/linking/static_lifetime_init.cpp b/src/linking/static_lifetime_init.cpp index 18087f472c9..451922abf1a 100644 --- a/src/linking/static_lifetime_init.cpp +++ b/src/linking/static_lifetime_init.cpp @@ -8,8 +8,6 @@ Author: Daniel Kroening, kroening@kroening.com #include "static_lifetime_init.h" -#include - #include #include #include @@ -90,10 +88,7 @@ static_lifetime_init(const irep_idt &identifier, symbol_tablet &symbol_table) else rhs = symbol.value; - code_assignt code(symbol.symbol_expr(), rhs); - code.add_source_location() = symbol.location; - - return std::move(code); + return code_frontend_assignt{symbol.symbol_expr(), rhs, symbol.location}; } void static_lifetime_init( @@ -156,9 +151,8 @@ void static_lifetime_init( code_type.return_type().id() == ID_constructor && code_type.parameters().empty()) { - code_function_callt function_call(symbol.symbol_expr()); - function_call.add_source_location()=source_location; - dest.add(function_call); + dest.add(code_expressiont{side_effect_expr_function_callt{ + symbol.symbol_expr(), {}, code_type.return_type(), source_location}}); } } }