[PATCH] D58538: [DebugInfo] Add source attributes for function declaration on behalf of owner CU

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 26 16:16:58 PST 2019


dblaikie accepted this revision.
dblaikie added a comment.
This revision is now accepted and ready to land.

Here's a bit of a smaller test that might make it clearer (could add some comments to help explain why each part is present):

  $ cat inc1.h
  struct S {
    template <typename T> static void tmpfn() {}
  };
  $ cat inc2.h
  extern int x;
  int x;
  $ cat foo.cpp
  #include "inc1.h"
  S s;
  blaikie at blaikie-linux2:~/dev/scratch$ cat bar.cpp
  #include "inc1.h"
  #include "inc2.h"
  void f3() { S::tmpfn<int>(); }

inc2.h in bar.cpp is, as you said, to increment the file number there so the file numbers in each CU don't line up coincidentally (it could contain any entity - an int seems the simplest)

Made the member function static and void - less DWARF to be emitted that way - no need for variables, etc.

I'll test a couple of related cases (implicit special members and nested classes) here in a moment & see if they have any related bugs.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D58538/new/

https://reviews.llvm.org/D58538





More information about the llvm-commits mailing list