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 17
17
#include " swift/SIL/SILUndef.h"
18
18
#include " swift/SIL/DynamicCasts.h"
19
19
#include " swift/SIL/Consumption.h"
20
+ #include " swift/SIL/SILInstruction.h"
20
21
#include " llvm/Support/Debug.h"
21
22
22
23
using namespace swift ;
@@ -1579,6 +1580,18 @@ swift::getSingleInitAllocStackUse(AllocStackInst *asi,
1579
1580
switch (user->getKind ()) {
1580
1581
default :
1581
1582
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
+ }
1582
1595
case SILInstructionKind::CheckedCastAddrBranchInst: {
1583
1596
auto *ccabi = cast<CheckedCastAddrBranchInst>(user);
1584
1597
// 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