diff options
author | Devang Patel <dpatel@apple.com> | 2010-09-29 19:08:08 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2010-09-29 19:08:08 +0000 |
commit | a1bd5a1fad40656e6783a14bdd408fc0a660a432 (patch) | |
tree | 9386f71da8fe7539dce8959323ff22bb53b2b676 /llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | |
parent | 08605205278f0d1f90bdb3b28185152e23039c44 (diff) | |
download | bcm5719-llvm-a1bd5a1fad40656e6783a14bdd408fc0a660a432.tar.gz bcm5719-llvm-a1bd5a1fad40656e6783a14bdd408fc0a660a432.zip |
Assign DW_ACCESS_public accessibility attribute to members by default.
llvm-svn: 115067
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index f26047aee43..36b9d75539f 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -1267,7 +1267,8 @@ DIE *DwarfDebug::createMemberDIE(DIDerivedType DT) { else if (DT.isPrivate()) addUInt(MemberDie, dwarf::DW_AT_accessibility, dwarf::DW_FORM_flag, dwarf::DW_ACCESS_private); - else if (DT.getTag() == dwarf::DW_TAG_inheritance) + // Otherwise C++ member and base classes are considered public. + else if (DT.getCompileUnit().getLanguage() == dwarf::DW_LANG_C_plus_plus) addUInt(MemberDie, dwarf::DW_AT_accessibility, dwarf::DW_FORM_flag, dwarf::DW_ACCESS_public); if (DT.isVirtual()) @@ -3168,6 +3169,14 @@ void DwarfDebug::emitDIE(DIE *Die) { Values[i]->EmitValue(Asm, Form); break; } + case dwarf::DW_AT_accessibility: { + if (Asm->isVerbose()) { + DIEInteger *V = cast<DIEInteger>(Values[i]); + Asm->OutStreamer.AddComment(dwarf::AccessibilityString(V->getValue())); + } + Values[i]->EmitValue(Asm, Form); + break; + } default: // Emit an attribute using the defined form. Values[i]->EmitValue(Asm, Form); |