[PATCH] D27462: For functions with debug info, do not propagate the callsite debug location to inlined instructions.

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 6 10:00:39 PST 2016


dblaikie added inline comments.


================
Comment at: lib/Transforms/Utils/InlineFunction.cpp:1375-1392
       DebugLoc DL = BI->getDebugLoc();
       if (!DL) {
+        if (CalleeHasDebugInfo)
+          continue;
         // If the inlined instruction has no line number, make it look as if it
         // originates from the call location. This is important for
         // ((__always_inline__, __nodebug__)) functions which must use caller
----------------
In a follow up commit it might be worth refactoring the body of this loop to something like:

  if (DebugLoc DL = ...) {
    BI->setDebugLoc(updateInlinedAtInfo(...));
    continue;
  }
  if (CalleeHasDebugInfo)
    continue;
  if (dyn_cast<AllocaInst>)
    if (allocaWouldBeStaticInEntry)
      continue;
  BI->setDebugLoc(TheCallDL);


================
Comment at: lib/Transforms/Utils/InlineFunction.cpp:1377-1378
       if (!DL) {
+        if (CalleeHasDebugInfo)
+          continue;
         // If the inlined instruction has no line number, make it look as if it
----------------
Leaving this instruction without a location at all may be problematic - it's still certainly inlined from this other function... - what can we do about that, if anything? (only thing that comes to mind is giving it a zero debug location, but that doesn't sound right)

Maybe no debug location is the right solution... - I wonder how that interacts with the inline range for the instruction, etc.


https://reviews.llvm.org/D27462





More information about the llvm-commits mailing list