[PATCH] D12913: Fixed debug info emitting for imported entity defined directly in a function scope.

Amjad Aboud via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 29 07:43:40 PDT 2015


aaboud marked an inline comment as done.

================
Comment at: test/DebugInfo/imported_entities.ll:12
@@ +11,3 @@
+;; This test was generated by running following command:
+;; clang -cc1 -O0 -g -emit-llvm test.cpp -o - | opt -S -inline -sroa
+;; Where test.cpp
----------------
dblaikie wrote:
> Why do you need SROA here?
It makes the LLVM IR simpler by removing the "lifetime" intrinsic that is added by the "-inline" pass.
Other than that it is not needed.

Anyway, once I use the "always_inline" attribute you suggested, there is no need for "-inline" nor "-soa" passes.

================
Comment at: test/DebugInfo/imported_entities.ll:19
@@ +18,3 @@
+;;
+;;static inline int foo(bool b) {
+;;  using namespace NameSpace;
----------------
dblaikie wrote:
> I usually write these tests by using __attribute__((always_inline)) then even at -O0 clang will run LLVM's AlwaysInliner and inline this, rather than relying on the normal inliner choosing to inline the function.
Turned to be a better way to write the test.
I just needed to keep the static, so clang can get rid of the inlined function once it inline it.


Repository:
  rL LLVM

http://reviews.llvm.org/D12913





More information about the llvm-commits mailing list