Skip to content

Commit 8753d48

Browse files
committed
CanonicalizeOSSALifetime: Distinguish destroys of the current def
1 parent 02385c8 commit 8753d48

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/SILOptimizer/Utils/CanonicalizeOSSALifetime.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -903,7 +903,7 @@ void CanonicalizeOSSALifetime::rewriteCopies() {
903903
defUseWorklist.insert(copy);
904904
return true;
905905
}
906-
if (auto *destroy = dyn_cast<DestroyValueInst>(user)) {
906+
if (auto *destroy = dynCastToDestroyOf(user, getCurrentDef())) {
907907
// If this destroy was marked as a final destroy, ignore it; otherwise,
908908
// delete it.
909909
if (!consumes.claimConsume(destroy)) {

0 commit comments

Comments
 (0)