[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:33:32 PST 2019


dblaikie added a comment.

> 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.

Yep, if you add a nested type you can see a similar bug:

  $ cat inc1.h
  struct S {
    struct Nested {};
  };
  $ cat bar.cpp
  #include "inc1.h"
  #include "inc2.h"
  void f3() {
    S::Nested n;
  }
  $ clang++-tot -emit-llvm foo.cpp bar.cpp -g -c && ~/dev/llvm/build/default/bin/llvm-link foo.bc bar.bc -o foobar.bc && clang++-tot foobar.bc -c && llvm-dwarfdump-tot -v -debug-info foobar.o | grep "strp.*\"Nested\"" -A2 -B2
  0x00000051:     DW_TAG_structure_type [6]  
                  DW_AT_calling_convention [DW_FORM_data1]      (DW_CC_pass_by_value)
                  DW_AT_name [DW_FORM_strp]     ( .debug_str[0x000000a7] = "Nested")
                  DW_AT_byte_size [DW_FORM_data1]       (0x01)
                  DW_AT_decl_file [DW_FORM_data1]       (0x03)

Probably to be fixed by similarly switching over to the appropriate unit just before "createAndAddDIE" in "getOrCreateTypeDIE" (maybe splitting off the tail of getOrCreateTypeDIE into an implementation function that can be called here). Does that make sense?


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

https://reviews.llvm.org/D58538





More information about the llvm-commits mailing list