Skip to content

Commit 81c4e07

Browse files
committed
Tell the SIL optimizer not to try to split up tuples with pack expansions.
This probably isn't the right way to do it --- maybe there isn't a right way to do it besides fixing the passes to handle this properly. But it gets the optimizer off our back for the moment.
1 parent 3bdee8c commit 81c4e07

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/SIL/IR/SILType.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,12 @@ bool SILType::aggregateHasUnreferenceableStorage() const {
453453
if (auto s = getStructOrBoundGenericStruct()) {
454454
return s->hasUnreferenceableStorage();
455455
}
456+
// Tuples with pack expansions don't *actually* have unreferenceable
457+
// storage, but the optimizer needs to be taught how to handle them,
458+
// and it won't do that correctly in the short term.
459+
if (auto t = getAs<TupleType>()) {
460+
return t.containsPackExpansionType();
461+
}
456462
return false;
457463
}
458464

0 commit comments

Comments
 (0)