diff options
author | NAKAMURA Takumi <geek4civic@gmail.com> | 2014-01-09 13:08:00 +0000 |
---|---|---|
committer | NAKAMURA Takumi <geek4civic@gmail.com> | 2014-01-09 13:08:00 +0000 |
commit | adff827c6aecbd4798cd4033a5fb1f0a63ff211a (patch) | |
tree | 85625a090e1deb0c8a8b6a7d45fb98d0aea79a97 /lib | |
parent | 3539d6d40ca8db81e0cf362d28cbb95734be82b5 (diff) | |
download | llvm-adff827c6aecbd4798cd4033a5fb1f0a63ff211a.tar.gz llvm-adff827c6aecbd4798cd4033a5fb1f0a63ff211a.tar.bz2 llvm-adff827c6aecbd4798cd4033a5fb1f0a63ff211a.tar.xz |
Revert r198851, "Prototype of skeleton type units for fission"
It caused undefined behavior. DwarfTypeUnit::Ty might not be initialized properly, I guess.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198865 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 22 | ||||
-rw-r--r-- | lib/CodeGen/AsmPrinter/DwarfDebug.h | 4 | ||||
-rw-r--r-- | lib/CodeGen/AsmPrinter/DwarfUnit.cpp | 4 | ||||
-rw-r--r-- | lib/MC/MCObjectFileInfo.cpp | 5 |
4 files changed, 6 insertions, 29 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 690ae37674..247cd04eac 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -2976,21 +2976,6 @@ DwarfCompileUnit *DwarfDebug::constructSkeletonCU(const DwarfCompileUnit *CU) { return NewCU; } -// This DIE has the following attributes: DW_AT_comp_dir, DW_AT_dwo_name, -// DW_AT_addr_base. -DwarfTypeUnit *DwarfDebug::constructSkeletonTU(const DwarfTypeUnit *TU) { - - DIE *Die = new DIE(dwarf::DW_TAG_type_unit); - DwarfTypeUnit *NewTU = new DwarfTypeUnit( - TU->getUniqueID(), Die, TU->getCUNode(), Asm, this, &SkeletonHolder); - NewTU->setTypeSignature(TU->getTypeSignature()); - NewTU->initSection( - Asm->getObjFileLowering().getDwarfTypesSection(TU->getTypeSignature())); - - initSkeletonUnit(TU, Die, NewTU); - return NewTU; -} - // Emit the .debug_info.dwo section for separated dwarf. This contains the // compile units that would normally be in debug_info. void DwarfDebug::emitDebugInfoDWO() { @@ -3033,6 +3018,8 @@ void DwarfDebug::addDwarfTypeUnitType(DICompileUnit CUNode, NewTU->addUInt(UnitDie, dwarf::DW_AT_language, dwarf::DW_FORM_data2, CUNode.getLanguage()); + DIE *Die = NewTU->createTypeDIE(CTy); + MD5 Hash; Hash.update(Identifier); // ... take the least significant 8 bytes and return those. Our MD5 @@ -3042,10 +3029,7 @@ void DwarfDebug::addDwarfTypeUnitType(DICompileUnit CUNode, Hash.final(Result); uint64_t Signature = *reinterpret_cast<support::ulittle64_t *>(Result + 8); NewTU->setTypeSignature(Signature); - if (useSplitDwarf()) - NewTU->setSkeleton(constructSkeletonTU(NewTU)); - - NewTU->setType(NewTU->createTypeDIE(CTy)); + NewTU->setType(Die); NewTU->initSection( useSplitDwarf() diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.h b/lib/CodeGen/AsmPrinter/DwarfDebug.h index 5a21106055..0c00c1be36 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.h +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.h @@ -596,10 +596,6 @@ class DwarfDebug : public AsmPrinterHandler { /// section. DwarfCompileUnit *constructSkeletonCU(const DwarfCompileUnit *CU); - /// \brief Construct the split debug info compile unit for the debug info - /// section. - DwarfTypeUnit *constructSkeletonTU(const DwarfTypeUnit *TU); - /// \brief Emit the debug info dwo section. void emitDebugInfoDWO(); diff --git a/lib/CodeGen/AsmPrinter/DwarfUnit.cpp b/lib/CodeGen/AsmPrinter/DwarfUnit.cpp index 7cf66954e4..b066c95fe9 100644 --- a/lib/CodeGen/AsmPrinter/DwarfUnit.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfUnit.cpp @@ -1987,9 +1987,7 @@ void DwarfTypeUnit::emitHeader(const MCSection *ASection, Asm->OutStreamer.AddComment("Type Signature"); Asm->OutStreamer.EmitIntValue(TypeSignature, sizeof(TypeSignature)); Asm->OutStreamer.AddComment("Type DIE Offset"); - // In a skeleton type unit there is no type DIE so emit a zero offset. - Asm->OutStreamer.EmitIntValue(Ty ? Ty->getOffset() : 0, - sizeof(Ty->getOffset())); + Asm->OutStreamer.EmitIntValue(Ty->getOffset(), sizeof(Ty->getOffset())); } void DwarfTypeUnit::initSection(const MCSection *Section) { diff --git a/lib/MC/MCObjectFileInfo.cpp b/lib/MC/MCObjectFileInfo.cpp index 4cc872ec0e..5d7a5f8863 100644 --- a/lib/MC/MCObjectFileInfo.cpp +++ b/lib/MC/MCObjectFileInfo.cpp @@ -726,9 +726,8 @@ const MCSection *MCObjectFileInfo::getDwarfTypesSection(uint64_t Hash) const { const MCSection * MCObjectFileInfo::getDwarfTypesDWOSection(uint64_t Hash) const { - return Ctx->getELFSection(".debug_types.dwo", ELF::SHT_PROGBITS, - ELF::SHF_GROUP, SectionKind::getMetadata(), 0, - utostr(Hash)); + return Ctx->getELFSection(".debug_types.dwo", ELF::SHT_GROUP, 0, + SectionKind::getMetadata(), 0, utostr(Hash)); } void MCObjectFileInfo::InitEHFrameSection() { |