Skip to content

Commit a8861ed

Browse files
authored
Merge pull request #8221 from tautschnig/cleanup/no-follow-linking
Static initialisation: Replace uses of namespacet::follow
2 parents 9411c77 + 1f9db02 commit a8861ed

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/linking/static_lifetime_init.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,24 +47,24 @@ static std::optional<codet> static_lifetime_init(
4747
if(identifier.starts_with(CPROVER_PREFIX "architecture_"))
4848
return {};
4949

50-
const typet &type = ns.follow(symbol.type);
51-
5250
// check type
53-
if(type.id() == ID_code || type.id() == ID_empty)
51+
if(symbol.type.id() == ID_code || symbol.type.id() == ID_empty)
5452
return {};
5553

56-
if(type.id() == ID_array && to_array_type(type).size().is_nil())
54+
if(symbol.type.id() == ID_array && to_array_type(symbol.type).size().is_nil())
5755
{
5856
// C standard 6.9.2, paragraph 5
5957
// adjust the type to an array of size 1
6058
symbolt &writable_symbol = symbol_table.get_writeable_ref(identifier);
61-
writable_symbol.type = type;
59+
writable_symbol.type = symbol.type;
6260
writable_symbol.type.set(ID_size, from_integer(1, size_type()));
6361
}
6462

6563
if(
66-
(type.id() == ID_struct || type.id() == ID_union) &&
67-
to_struct_union_type(type).is_incomplete())
64+
(symbol.type.id() == ID_struct_tag &&
65+
ns.follow_tag(to_struct_tag_type(symbol.type)).is_incomplete()) ||
66+
(symbol.type.id() == ID_union_tag &&
67+
ns.follow_tag(to_union_tag_type(symbol.type)).is_incomplete()))
6868
{
6969
return {}; // do not initialize
7070
}

0 commit comments

Comments
 (0)