[PATCH] D38078: [dsymutil] Don't resolve DIE reference to NULL DIE.

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 20 09:58:45 PDT 2017


dblaikie added inline comments.


================
Comment at: test/tools/dsymutil/X86/null-die.test:10-19
+#   int foo(int i) __attribute__((always_inline));
+#   int foo(int i)
+#   {
+#     return i + 10;
+#   }
+#
+#   int main(int argc, char** argv)
----------------
This DWARF could be a bit simpler by skipping argc and argv and having foo be void() rather than int(int), have foo call some other function & compile without optimizations:

  void f1() {}
  __attribute__((always_inline)) void f2() {
    f1();
  }
  int main() {
    f2();
  }

(marginally simpler if 'int main' were just 'void f3' - though then I guess you'd need a stub object (which wouldn't need debug info anyway) to link in main, not sure, which might be more hassle than necessary - if you did that you could also put f1 out of line in that object file so there would be no DWARF for f1 either, again simplifying the test case a bit)

Also potentially simpler if this is in C++ and f2 is marked 'inline' as well, that way there's no out of line definition of f2.

  



https://reviews.llvm.org/D38078





More information about the llvm-commits mailing list