Skip to content

Commit bfdbce9

Browse files
authored
Merge pull request #6554 from tautschnig/linking-assign
Linking/static lifetime init: do not use goto code types
2 parents 8fc7e62 + 13d86b0 commit bfdbce9

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

src/linking/static_lifetime_init.cpp

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ Author: Daniel Kroening, [email protected]
88

99
#include "static_lifetime_init.h"
1010

11-
#include <goto-programs/goto_instruction_code.h>
12-
1311
#include <util/arith_tools.h>
1412
#include <util/c_types.h>
1513
#include <util/expr_initializer.h>
@@ -90,10 +88,7 @@ static_lifetime_init(const irep_idt &identifier, symbol_tablet &symbol_table)
9088
else
9189
rhs = symbol.value;
9290

93-
code_assignt code(symbol.symbol_expr(), rhs);
94-
code.add_source_location() = symbol.location;
95-
96-
return std::move(code);
91+
return code_frontend_assignt{symbol.symbol_expr(), rhs, symbol.location};
9792
}
9893

9994
void static_lifetime_init(
@@ -156,9 +151,8 @@ void static_lifetime_init(
156151
code_type.return_type().id() == ID_constructor &&
157152
code_type.parameters().empty())
158153
{
159-
code_function_callt function_call(symbol.symbol_expr());
160-
function_call.add_source_location()=source_location;
161-
dest.add(function_call);
154+
dest.add(code_expressiont{side_effect_expr_function_callt{
155+
symbol.symbol_expr(), {}, code_type.return_type(), source_location}});
162156
}
163157
}
164158
}

0 commit comments

Comments
 (0)