File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 1717#include " swift/SIL/SILUndef.h"
1818#include " swift/SIL/DynamicCasts.h"
1919#include " swift/SIL/Consumption.h"
20+ #include " swift/SIL/SILInstruction.h"
2021#include " llvm/Support/Debug.h"
2122
2223using namespace swift ;
@@ -1579,6 +1580,18 @@ swift::getSingleInitAllocStackUse(AllocStackInst *asi,
15791580 switch (user->getKind ()) {
15801581 default :
15811582 break ;
1583+ case SILInstructionKind::UnconditionalCheckedCastAddrInst: {
1584+ auto *uccai = cast<UnconditionalCheckedCastAddrInst>(user);
1585+ // Only handle the case where we are doing a take of our alloc_stack as a
1586+ // source value. If we are the dest, then something else is happening!
1587+ // Break!
1588+ if (use->get () == uccai->getDest ())
1589+ break ;
1590+ // Ok, we are the Src and are performing a take. Treat it as a destroy!
1591+ if (destroyingUses)
1592+ destroyingUses->push_back (use);
1593+ continue ;
1594+ }
15821595 case SILInstructionKind::CheckedCastAddrBranchInst: {
15831596 auto *ccabi = cast<CheckedCastAddrBranchInst>(user);
15841597 // We only handle the case where we are doing a take of our alloc_stack as
You can’t perform that action at this time.
0 commit comments