diff options
author | Adrian Prantl <aprantl@apple.com> | 2019-05-07 17:42:38 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2019-05-07 17:42:38 +0000 |
commit | e6e8db5e9bc5720f3ce29c17d334d156bd812947 (patch) | |
tree | 7a0b0f0088a7007c255345e7f43d482718270c02 /llvm/lib/CodeGen | |
parent | cc63db4ff0f9dfe0b380647ba3f67ba6952d0ee2 (diff) | |
download | bcm5719-llvm-e6e8db5e9bc5720f3ce29c17d334d156bd812947.tar.gz bcm5719-llvm-e6e8db5e9bc5720f3ce29c17d334d156bd812947.zip |
Debug Info: Support address space attributes on rvalue references.
DWARF5, 2.12 20ff says that
Any debugging information entry representing a pointer or reference
type [may have a DW_AT_address_class attribute].
The existing code (https://reviews.llvm.org/D29670) seems to take a
quite literal interpretation of that wording. I don't see a reason why
an rvalue reference isn't a reference type in the spirit of that
paragraph. This patch allows rvalue references to also have address
spaces.
rdar://problem/50511483
Differential Revision: https://reviews.llvm.org/D61625
llvm-svn: 360176
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp index 0ab0a1ed04c..3aa404ed4e9 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp @@ -794,10 +794,10 @@ void DwarfUnit::constructTypeDIE(DIE &Buffer, const DIDerivedType *DTy) { if (!DTy->isForwardDecl()) addSourceLine(Buffer, DTy); - // If DWARF address space value is other than None, add it for pointer and - // reference types as DW_AT_address_class. - if (DTy->getDWARFAddressSpace() && (Tag == dwarf::DW_TAG_pointer_type || - Tag == dwarf::DW_TAG_reference_type)) + // If DWARF address space value is other than None, add it. The IR + // verifier checks that DWARF address space only exists for pointer + // or reference types. + if (DTy->getDWARFAddressSpace()) addUInt(Buffer, dwarf::DW_AT_address_class, dwarf::DW_FORM_data4, DTy->getDWARFAddressSpace().getValue()); } |