diff --git a/llvm/lib/Transforms/Coroutines/CoroFrame.cpp b/llvm/lib/Transforms/Coroutines/CoroFrame.cpp --- a/llvm/lib/Transforms/Coroutines/CoroFrame.cpp +++ b/llvm/lib/Transforms/Coroutines/CoroFrame.cpp @@ -1714,7 +1714,7 @@ StructType *FrameTy = Shape.FrameTy; Value *FramePtr = Shape.FramePtr; DominatorTree DT(*F); - SmallDenseMap DbgPtrAllocaCache; + SmallDenseMap ArgToAllocaMap; // Create a GEP with the given index into the coroutine frame for the original // value Orig. Appends an extra 0 index for array-allocas, preserving the @@ -1873,7 +1873,7 @@ &*Builder.GetInsertPoint()); // This dbg.declare is for the main function entry point. It // will be deleted in all coro-split functions. - coro::salvageDebugInfo(DbgPtrAllocaCache, DDI, Shape.OptimizeFrame); + coro::salvageDebugInfo(ArgToAllocaMap, DDI, Shape.OptimizeFrame); } } @@ -2815,7 +2815,7 @@ } void coro::salvageDebugInfo( - SmallDenseMap &DbgPtrAllocaCache, + SmallDenseMap &ArgToAllocaMap, DbgVariableIntrinsic *DVI, bool OptimizeFrame) { Function *F = DVI->getFunction(); IRBuilder<> Builder(F->getContext()); @@ -2870,8 +2870,8 @@ // Avoid to create the alloca would be eliminated by optimization // passes and the corresponding dbg.declares would be invalid. if (!OptimizeFrame) - if (auto *Arg = dyn_cast(Storage)) { - auto &Cached = DbgPtrAllocaCache[Storage]; + if (auto *Arg = dyn_cast(Storage)) { + auto &Cached = ArgToAllocaMap[Arg]; if (!Cached) { Cached = Builder.CreateAlloca(Storage->getType(), 0, nullptr, Arg->getName() + ".debug"); diff --git a/llvm/lib/Transforms/Coroutines/CoroInternal.h b/llvm/lib/Transforms/Coroutines/CoroInternal.h --- a/llvm/lib/Transforms/Coroutines/CoroInternal.h +++ b/llvm/lib/Transforms/Coroutines/CoroInternal.h @@ -31,7 +31,7 @@ /// If the frame pointer is an Argument, store it into an alloca if /// OptimizeFrame is false. void salvageDebugInfo( - SmallDenseMap &DbgPtrAllocaCache, + SmallDenseMap &ArgToAllocaMap, DbgVariableIntrinsic *DVI, bool OptimizeFrame); // Keeps data and helper functions for lowering coroutine intrinsics. diff --git a/llvm/lib/Transforms/Coroutines/CoroSplit.cpp b/llvm/lib/Transforms/Coroutines/CoroSplit.cpp --- a/llvm/lib/Transforms/Coroutines/CoroSplit.cpp +++ b/llvm/lib/Transforms/Coroutines/CoroSplit.cpp @@ -697,9 +697,9 @@ void CoroCloner::salvageDebugInfo() { SmallVector Worklist = collectDbgVariableIntrinsics(*NewF); - SmallDenseMap DbgPtrAllocaCache; + SmallDenseMap ArgToAllocaMap; for (DbgVariableIntrinsic *DVI : Worklist) - coro::salvageDebugInfo(DbgPtrAllocaCache, DVI, Shape.OptimizeFrame); + coro::salvageDebugInfo(ArgToAllocaMap, DVI, Shape.OptimizeFrame); // Remove all salvaged dbg.declare intrinsics that became // either unreachable or stale due to the CoroSplit transformation. @@ -1981,9 +1981,9 @@ // Salvage debug intrinsics that point into the coroutine frame in the // original function. The Cloner has already salvaged debug info in the new // coroutine funclets. - SmallDenseMap DbgPtrAllocaCache; + SmallDenseMap ArgToAllocaMap; for (auto *DDI : collectDbgVariableIntrinsics(F)) - coro::salvageDebugInfo(DbgPtrAllocaCache, DDI, Shape.OptimizeFrame); + coro::salvageDebugInfo(ArgToAllocaMap, DDI, Shape.OptimizeFrame); return Shape; }