summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2014-01-31 19:52:26 +0000
committerDavid Blaikie <dblaikie@gmail.com>2014-01-31 19:52:26 +0000
commit0451736fc9e36e6e525460871020724204f4da5a (patch)
tree992bc7f7dbf8d6e0fb92b3e2aa1f0c9a6b94f472 /lib
parent4fa3492f97fcf9d35e085840b62fe2e5b0ca7214 (diff)
downloadllvm-0451736fc9e36e6e525460871020724204f4da5a.tar.gz
llvm-0451736fc9e36e6e525460871020724204f4da5a.tar.bz2
llvm-0451736fc9e36e6e525460871020724204f4da5a.tar.xz
DebugInfo: Flag type unit references as declarations
This ensures DWARF consumers don't confuse these references for definitions. I'd argue it might be nice to improve debuggers so we don't need this, but it's just one field in an abbreviation anyway - so it doesn't seem worth the fight. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200569 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfDebug.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index e4188c39b0..24beebbd35 100644
--- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -3016,6 +3016,11 @@ void DwarfDebug::emitDebugStrDWO() {
void DwarfDebug::addDwarfTypeUnitType(DICompileUnit CUNode,
StringRef Identifier, DIE *RefDie,
DICompositeType CTy) {
+ // Flag the type unit reference as a declaration so that if it contains
+ // members (implicit special members, static data member definitions, member
+ // declarations for definitions in this CU, etc) consumers don't get confused
+ // and think this is a full definition.
+ CUMap.begin()->second->addFlag(RefDie, dwarf::DW_AT_declaration);
const DwarfTypeUnit *&TU = DwarfTypeUnits[CTy];
if (TU) {