@@ -5389,8 +5389,11 @@ void IRGenSILFunction::emitDebugInfoForAllocStack(AllocStackInst *i,
53895389 assert (isa<llvm::AllocaInst>(addr) || isa<llvm::UndefValue>(addr) ||
53905390 isa<llvm::IntrinsicInst>(addr) || isCallToSwiftTaskAlloc (addr));
53915391
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+
53945397 if (!IGM.IRGen .Opts .DisableDebuggerShadowCopies &&
53955398 !IGM.IRGen .Opts .shouldOptimize ())
53965399 if (auto *Alloca = dyn_cast<llvm::AllocaInst>(addr))
@@ -5434,25 +5437,6 @@ void IRGenSILFunction::emitDebugInfoForAllocStack(AllocStackInst *i,
54345437 } else
54355438 return ;
54365439
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-
54565440 bindArchetypes (DbgTy.getType ());
54575441 if (IGM.DebugInfo ) {
54585442 emitDebugVariableDeclaration (addr, DbgTy, SILTy, DS, i->getLoc (), *VarInfo,
0 commit comments