@@ -5389,8 +5389,11 @@ void IRGenSILFunction::emitDebugInfoForAllocStack(AllocStackInst *i,
5389
5389
assert (isa<llvm::AllocaInst>(addr) || isa<llvm::UndefValue>(addr) ||
5390
5390
isa<llvm::IntrinsicInst>(addr) || isCallToSwiftTaskAlloc (addr));
5391
5391
5392
- auto Indirection =
5393
- InCoroContext (*CurSILFn, *i) ? CoroDirectValue : DirectValue;
5392
+ auto Indirection = DirectValue;
5393
+ if (InCoroContext (*CurSILFn, *i))
5394
+ Indirection =
5395
+ isCallToSwiftTaskAlloc (addr) ? CoroIndirectValue : CoroDirectValue;
5396
+
5394
5397
if (!IGM.IRGen .Opts .DisableDebuggerShadowCopies &&
5395
5398
!IGM.IRGen .Opts .shouldOptimize ())
5396
5399
if (auto *Alloca = dyn_cast<llvm::AllocaInst>(addr))
@@ -5434,25 +5437,6 @@ void IRGenSILFunction::emitDebugInfoForAllocStack(AllocStackInst *i,
5434
5437
} else
5435
5438
return ;
5436
5439
5437
- // Async functions use the value of the artificial address.
5438
- auto shadow = addr;
5439
- if (CurSILFn->isAsync () && emitLifetimeExtendingUse (shadow) &&
5440
- !isa<llvm::UndefValue>(shadow)) {
5441
- if (ValueVariables.insert (shadow).second )
5442
- ValueDomPoints.push_back ({shadow, getActiveDominancePoint ()});
5443
- auto shadowInst = cast<llvm::Instruction>(shadow);
5444
- llvm::IRBuilder<> builder (shadowInst->getNextNode ());
5445
- llvm::Type *shadowTy = IGM.IntPtrTy ;
5446
- if (auto *alloca = dyn_cast<llvm::AllocaInst>(shadow)) {
5447
- shadowTy = alloca->getAllocatedType ();
5448
- } else if (isCallToSwiftTaskAlloc (shadow)) {
5449
- shadowTy = IGM.Int8Ty ;
5450
- }
5451
- assert (!IGM.getLLVMContext ().supportsTypedPointers () ||
5452
- shadowTy == shadow->getType ()->getNonOpaquePointerElementType ());
5453
- addr = builder.CreateLoad (shadowTy, shadow);
5454
- }
5455
-
5456
5440
bindArchetypes (DbgTy.getType ());
5457
5441
if (IGM.DebugInfo ) {
5458
5442
emitDebugVariableDeclaration (addr, DbgTy, SILTy, DS, i->getLoc (), *VarInfo,
0 commit comments