File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
llvm/lib/Transforms/Coroutines Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -2953,6 +2953,9 @@ void coro::salvageDebugInfo(
2953
2953
std::optional<BasicBlock::iterator> InsertPt;
2954
2954
if (auto *I = dyn_cast<Instruction>(Storage)) {
2955
2955
InsertPt = I->getInsertionPointAfterDef ();
2956
+ // Update DILocation only in O0 since it is easy to get out of sync in
2957
+ // optimizations. See https://github.com/llvm/llvm-project/pull/75104 for
2958
+ // an example.
2956
2959
if (!OptimizeFrame && I->getDebugLoc ())
2957
2960
DVI.setDebugLoc (I->getDebugLoc ());
2958
2961
} else if (isa<Argument>(Storage))
@@ -2988,9 +2991,14 @@ void coro::salvageDebugInfo(
2988
2991
// dbg.declare does.
2989
2992
if (DPV.getType () == DPValue::LocationType::Declare) {
2990
2993
std::optional<BasicBlock::iterator> InsertPt;
2991
- if (auto *I = dyn_cast<Instruction>(Storage))
2994
+ if (auto *I = dyn_cast<Instruction>(Storage)) {
2992
2995
InsertPt = I->getInsertionPointAfterDef ();
2993
- else if (isa<Argument>(Storage))
2996
+ // Update DILocation only in O0 since it is easy to get out of sync in
2997
+ // optimizations. See https://github.com/llvm/llvm-project/pull/75104 for
2998
+ // an example.
2999
+ if (!OptimizeFrame && I->getDebugLoc ())
3000
+ DPV.setDebugLoc (I->getDebugLoc ());
3001
+ } else if (isa<Argument>(Storage))
2994
3002
InsertPt = F->getEntryBlock ().begin ();
2995
3003
if (InsertPt) {
2996
3004
DPV.removeFromParent ();
You can’t perform that action at this time.
0 commit comments