Skip to content

Commit a2f062b

Browse files
committed
[TypeLowering] Mark lexical when marking non-trivial.
In addition to starting all RecursiveProperties values which are NonTrivial as Lexical, also mark instances of the structs which are modified to become NonTrivial to simultaneously become Lexical.
1 parent f3cc081 commit a2f062b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/SIL/IR/TypeLowering.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2099,6 +2099,7 @@ namespace {
20992099
if (D->isCxxNonTrivial()) {
21002100
properties.setAddressOnly();
21012101
properties.setNonTrivial();
2102+
properties.setLexical(IsLexical);
21022103
}
21032104

21042105
auto subMap = structType->getContextSubstitutionMap(&TC.M, D);
@@ -2158,6 +2159,9 @@ namespace {
21582159
// may be added resiliently later.
21592160
if (D->isIndirect()) {
21602161
properties.setNonTrivial();
2162+
properties.setLexical(IsLexical);
2163+
properties =
2164+
applyLifetimeAnnotation(D->getLifetimeAnnotation(), properties);
21612165
return new (TC) LoadableEnumTypeLowering(enumType, properties,
21622166
Expansion);
21632167
}
@@ -2173,6 +2177,9 @@ namespace {
21732177
// Indirect elements only make the type nontrivial.
21742178
if (elt->isIndirect()) {
21752179
properties.setNonTrivial();
2180+
properties.setLexical(IsLexical);
2181+
properties =
2182+
applyLifetimeAnnotation(elt->getLifetimeAnnotation(), properties);
21762183
continue;
21772184
}
21782185

0 commit comments

Comments
 (0)