[PATCH] Fix line numbers for code inlined from __nodebug__ functions.

Evgeniy Stepanov eugenis at google.com
Tue Jun 3 02:01:29 PDT 2014


I've also included updates to tests in clang and compiler-rt that were earlier sent as a separate CL.

Btw, is there any reason not to commit CLs spanning multiple llvm projects as one? This seems to work perfectly well, but for some reason people often do multiple commits with inconsistent state in between.

================
Comment at: lib/Transforms/Utils/InlineFunction.cpp:472-473
@@ +471,4 @@
+        // originates from the call location. This covers the case of
+        // ((__always_inline__, __nodebug__)) functions in *intrin.h missing
+        // line numbers after inlining.
+        BI->setDebugLoc(TheCallDL);
----------------
Chandler Carruth wrote:
> Rather than mentioning *intrin.h functions, I would just say that this is important for ((__always_inline__, __nodebug__)) functions to at least have *some* location after inlining.
done

================
Comment at: test/Transforms/Inline/inline-line-numbers.ll:2
@@ +1,3 @@
+; RUN: opt < %s -inline -S | FileCheck %s
+
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
----------------
David Blaikie wrote:
> Do you have the original source for this test? I imagine these functions could be a little simpler, maybe? (do they need parameters/return values? It's unlikely the outer function (test2) does, I imagine - the inner function might be slightly simpler, while still having an un-elidable instruction, if it just assigned a constant to a global? Maybe there's some other simple operation it could perform)
I've simplified the test and included the original source to simplify future modifications.

http://reviews.llvm.org/D3988






More information about the llvm-commits mailing list