diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2024-01-03 18:04:11 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2024-04-06 20:13:16 +0000 |
| commit | 647cbc5de815c5651677bf8582797f716ec7b48d (patch) | |
| tree | 0a57db146d82068137e0fe0109ca612aaef5afb6 /contrib/llvm-project/llvm/lib/Transforms/Coroutines | |
| parent | edc2dc17b1f2dfe45dc85e6cc0ff54bca1ac8214 (diff) | |
| parent | 77dbea07356e1ab2f37a777d4d1ddc5dd3e301c2 (diff) | |
Diffstat (limited to 'contrib/llvm-project/llvm/lib/Transforms/Coroutines')
| -rw-r--r-- | contrib/llvm-project/llvm/lib/Transforms/Coroutines/CoroFrame.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/contrib/llvm-project/llvm/lib/Transforms/Coroutines/CoroFrame.cpp b/contrib/llvm-project/llvm/lib/Transforms/Coroutines/CoroFrame.cpp index f37b4dc938d3..529f7309a1a2 100644 --- a/contrib/llvm-project/llvm/lib/Transforms/Coroutines/CoroFrame.cpp +++ b/contrib/llvm-project/llvm/lib/Transforms/Coroutines/CoroFrame.cpp @@ -2951,9 +2951,11 @@ void coro::salvageDebugInfo( // dbg.declare does. if (isa<DbgDeclareInst>(DVI)) { std::optional<BasicBlock::iterator> InsertPt; - if (auto *I = dyn_cast<Instruction>(Storage)) + if (auto *I = dyn_cast<Instruction>(Storage)) { InsertPt = I->getInsertionPointAfterDef(); - else if (isa<Argument>(Storage)) + if (!OptimizeFrame && I->getDebugLoc()) + DVI.setDebugLoc(I->getDebugLoc()); + } else if (isa<Argument>(Storage)) InsertPt = F->getEntryBlock().begin(); if (InsertPt) DVI.moveBefore(*(*InsertPt)->getParent(), *InsertPt); |
