aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/InlineFunction.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Transforms/Utils/InlineFunction.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/InlineFunction.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Utils/InlineFunction.cpp b/llvm/lib/Transforms/Utils/InlineFunction.cpp
index eaf57e7..2412146 100644
--- a/llvm/lib/Transforms/Utils/InlineFunction.cpp
+++ b/llvm/lib/Transforms/Utils/InlineFunction.cpp
@@ -1827,10 +1827,16 @@ static DebugLoc inlineDebugLoc(DebugLoc OrigDL, DILocation *InlinedAt,
/// to encode location where these instructions are inlined.
static void fixupLineNumbers(Function *Fn, Function::iterator FI,
Instruction *TheCall, bool CalleeHasDebugInfo) {
- const DebugLoc &TheCallDL = TheCall->getDebugLoc();
- if (!TheCallDL)
+ if (!TheCall->getDebugLoc())
return;
+ // Don't propagate the source location atom from the call to inlined nodebug
+ // instructions, and avoid putting it in the InlinedAt field of inlined
+ // not-nodebug instructions. FIXME: Possibly worth transferring/generating
+ // an atom for the returned value, otherwise we miss stepping on inlined
+ // nodebug functions (which is different to existing behaviour).
+ DebugLoc TheCallDL = TheCall->getDebugLoc().get()->getWithoutAtom();
+
auto &Ctx = Fn->getContext();
DILocation *InlinedAtNode = TheCallDL;