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

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 24 16:00:06 PDT 2015


dblaikie added a comment.

Just glanced at the tests, haven't looked at the code yet.

(not sure if the test filecheck lines should be further simplified by dropping some of the attributes - the basics of line/file location on imported entities is tested elsewhere, perhaps this test should just focus on where the imported entities are placed in the DIE tree)


================
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
----------------
Why do you need SROA here?

================
Comment at: test/DebugInfo/imported_entities.ll:19
@@ +18,3 @@
+;;
+;;static inline int foo(bool b) {
+;;  using namespace NameSpace;
----------------
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.

================
Comment at: test/DebugInfo/imported_entities.ll:26
@@ +25,3 @@
+;;int bar(bool b) {
+;;  return foo(b);
+;;}
----------------
Is the parameter necessary? If you need to leave breadcrumbs to ensure that foo is inlined and not optimized away, you can add a call to an external function in the inlined function:

  void f1();
  __attribute__((alwaysinline)) void f2() {
    using ...;
    f1();
  }
  void f3() {
    f2();
  }


Repository:
  rL LLVM

http://reviews.llvm.org/D12913





More information about the llvm-commits mailing list