Skip to content

Commit f9b4ac7

Browse files
committed
[semantic-arc] Make sure that the ownership model eliminator sets the unqualified flag before it runs.
Otherwise, we will trigger verification in SILBuilder?! rdar://28851920
1 parent d49a246 commit f9b4ac7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/SILOptimizer/Transforms/OwnershipModelEliminator.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,10 @@ namespace {
151151
struct OwnershipModelEliminator : SILFunctionTransform {
152152
void run() override {
153153
SILFunction *F = getFunction();
154+
155+
// Set F to have unqualified ownership.
156+
F->setUnqualifiedOwnership();
157+
154158
bool MadeChange = false;
155159
SILBuilder B(*F);
156160
OwnershipModelEliminatorVisitor Visitor(B);
@@ -171,10 +175,6 @@ struct OwnershipModelEliminator : SILFunctionTransform {
171175
// that analysis.
172176
invalidateAnalysis(SILAnalysis::InvalidationKind::Instructions);
173177
}
174-
175-
// Now that we have lowered to unqualified ownership, set the unqualified
176-
// ownership flag on the function.
177-
F->setUnqualifiedOwnership();
178178
}
179179

180180
StringRef getName() override { return "Ownership Model Eliminator"; }

0 commit comments

Comments
 (0)