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