diff options
author | Devang Patel <dpatel@apple.com> | 2011-09-14 23:13:28 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2011-09-14 23:13:28 +0000 |
commit | 04d6d478650503e74d2f7e8337e6c2b381ba1bc7 (patch) | |
tree | 9c0f35d638ad0d3f967891c691b1bbaa747eaa21 /llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp | |
parent | 21931efc4d1216267cc1aed156155d1a8d174956 (diff) | |
download | bcm5719-llvm-04d6d478650503e74d2f7e8337e6c2b381ba1bc7.tar.gz bcm5719-llvm-04d6d478650503e74d2f7e8337e6c2b381ba1bc7.zip |
Add support to emit debug info for C++0x nullptr type.
llvm-svn: 139751
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp index d6be3f3f5b7..33a065d5843 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp @@ -658,13 +658,20 @@ void CompileUnit::addPubTypes(DISubprogram SP) { void CompileUnit::constructTypeDIE(DIE &Buffer, DIBasicType BTy) { // Get core information. StringRef Name = BTy.getName(); - Buffer.setTag(dwarf::DW_TAG_base_type); - addUInt(&Buffer, dwarf::DW_AT_encoding, dwarf::DW_FORM_data1, - BTy.getEncoding()); - // Add name if not anonymous or intermediate type. if (!Name.empty()) addString(&Buffer, dwarf::DW_AT_name, dwarf::DW_FORM_string, Name); + + if (BTy.getTag() == dwarf::DW_TAG_unspecified_type) { + Buffer.setTag(dwarf::DW_TAG_unspecified_type); + // Unspecified types has only name, nothing else. + return; + } + + Buffer.setTag(dwarf::DW_TAG_base_type); + addUInt(&Buffer, dwarf::DW_AT_encoding, dwarf::DW_FORM_data1, + BTy.getEncoding()); + uint64_t Size = BTy.getSizeInBits() >> 3; addUInt(&Buffer, dwarf::DW_AT_byte_size, 0, Size); } |