diff options
author | David Blaikie <dblaikie@gmail.com> | 2013-12-13 06:43:32 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2013-12-13 06:43:32 +0000 |
commit | 2d39ad82bc64c5fd4536fe02bb6ab3f153a7dfac (patch) | |
tree | 5183e3887d3ed643534806b7572ee99239f749e6 /lib | |
parent | bc6b250c740bef28bb30ddea5321d9b0de0ec60c (diff) | |
download | llvm-2d39ad82bc64c5fd4536fe02bb6ab3f153a7dfac.tar.gz llvm-2d39ad82bc64c5fd4536fe02bb6ab3f153a7dfac.tar.bz2 llvm-2d39ad82bc64c5fd4536fe02bb6ab3f153a7dfac.tar.xz |
Revert "DebugInfo: Move type units into the debug_types section with appropriate comdat grouping and type unit headers"
This reverts commit r197210.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197211 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 12 | ||||
-rw-r--r-- | lib/CodeGen/AsmPrinter/DwarfUnit.cpp | 24 | ||||
-rw-r--r-- | lib/CodeGen/AsmPrinter/DwarfUnit.h | 18 | ||||
-rw-r--r-- | lib/DebugInfo/DWARFContext.cpp | 6 | ||||
-rw-r--r-- | lib/DebugInfo/DWARFContext.h | 11 | ||||
-rw-r--r-- | lib/MC/MCObjectFileInfo.cpp | 12 |
6 files changed, 18 insertions, 65 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 7c61407e87..27348a4b9b 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -3056,17 +3056,19 @@ void DwarfDebug::addDwarfTypeUnitType(uint16_t Language, DIE *RefDie, // referenced type, or possibly walk the precomputed hashes of related types // at the end. uint64_t Signature = DIEHash().computeTypeSignature(*Die); - NewTU->setTypeSignature(Signature); - NewTU->setType(Die); // Remove the References vector and add the type hash. I->second.first = Signature; I->second.second = NULL; NewTU->initSection( - useSplitDwarf() - ? Asm->getObjFileLowering().getDwarfTypesDWOSection(Signature) - : Asm->getObjFileLowering().getDwarfTypesSection(Signature)); + useSplitDwarf() ? Asm->getObjFileLowering().getDwarfInfoDWOSection() + : Asm->getObjFileLowering().getDwarfInfoSection(), + // FIXME: This is subtle (using the info section even when + // this CU is in the dwo section) and necessary for the + // current arange code - ideally it should iterate + // skeleton units, not full units, if it's going to reference skeletons + useSplitDwarf() ? NULL : DwarfInfoSectionSym); } // Populate all the signatures. diff --git a/lib/CodeGen/AsmPrinter/DwarfUnit.cpp b/lib/CodeGen/AsmPrinter/DwarfUnit.cpp index 709f5bec03..f87480d290 100644 --- a/lib/CodeGen/AsmPrinter/DwarfUnit.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfUnit.cpp @@ -1997,27 +1997,3 @@ void DwarfUnit::emitHeader(const MCSection *ASection, Asm->OutStreamer.AddComment("Address Size (in bytes)"); Asm->EmitInt8(Asm->getDataLayout().getPointerSize()); } - -void DwarfTypeUnit::emitHeader(const MCSection *ASection, - const MCSymbol *ASectionSym) const { - DwarfUnit::emitHeader(ASection, ASectionSym); - Asm->OutStreamer.AddComment("Type Signature"); - Asm->OutStreamer.EmitIntValue(TypeSignature, sizeof(TypeSignature)); - Asm->OutStreamer.AddComment("Type DIE Offset"); - Asm->OutStreamer.EmitIntValue(Ty->getOffset(), sizeof(Ty->getOffset())); -} - -void DwarfTypeUnit::initSection(const MCSection *Section) { - assert(!this->Section); - this->Section = Section; - // Since each type unit is contained in its own COMDAT section, the begin - // label and the section label are the same. Using the begin label emission in - // DwarfDebug to emit the section label as well is slightly subtle/sneaky, but - // the only other alternative of lazily constructing start-of-section labels - // and storing a mapping in DwarfDebug (or AsmPrinter). - this->SectionSym = this->LabelBegin = - Asm->GetTempSymbol(Section->getLabelBeginName(), getUniqueID()); - this->LabelEnd = - Asm->GetTempSymbol(Section->getLabelEndName(), getUniqueID()); - this->LabelRange = Asm->GetTempSymbol("gnu_ranges", getUniqueID()); -} diff --git a/lib/CodeGen/AsmPrinter/DwarfUnit.h b/lib/CodeGen/AsmPrinter/DwarfUnit.h index 6242a058cf..26b5f09004 100644 --- a/lib/CodeGen/AsmPrinter/DwarfUnit.h +++ b/lib/CodeGen/AsmPrinter/DwarfUnit.h @@ -413,15 +413,14 @@ public: /// Compute the size of a header for this unit, not including the initial /// length field. - virtual unsigned getHeaderSize() const { + unsigned getHeaderSize() const { return sizeof(int16_t) + // DWARF version number sizeof(int32_t) + // Offset Into Abbrev. Section sizeof(int8_t); // Pointer Size (in bytes) } /// Emit the header for this unit, not including the initial length field. - virtual void emitHeader(const MCSection *ASection, - const MCSymbol *ASectionSym) const; + void emitHeader(const MCSection *ASection, const MCSymbol *ASectionSym) const; protected: /// getOrCreateStaticMemberDIE - Create new static data member DIE. @@ -514,25 +513,12 @@ public: class DwarfTypeUnit : public DwarfUnit { private: uint16_t Language; - uint64_t TypeSignature; - const DIE *Ty; public: DwarfTypeUnit(unsigned UID, DIE *D, uint16_t Language, AsmPrinter *A, DwarfDebug *DW, DwarfFile *DWU); - void setTypeSignature(uint64_t Signature) { TypeSignature = Signature; } - void setType(const DIE *Ty) { this->Ty = Ty; } - uint16_t getLanguage() const LLVM_OVERRIDE { return Language; } - /// Emit the header for this unit, not including the initial length field. - void emitHeader(const MCSection *ASection, const MCSymbol *ASectionSym) const - LLVM_OVERRIDE; - unsigned getHeaderSize() const LLVM_OVERRIDE { - return DwarfUnit::getHeaderSize() + sizeof(uint64_t) + // Type Signature - sizeof(uint32_t); // Type DIE Offset - } - void initSection(const MCSection *Section); }; } // end llvm namespace #endif diff --git a/lib/DebugInfo/DWARFContext.cpp b/lib/DebugInfo/DWARFContext.cpp index d10c4b4c31..eaeb2dcc1c 100644 --- a/lib/DebugInfo/DWARFContext.cpp +++ b/lib/DebugInfo/DWARFContext.cpp @@ -297,8 +297,10 @@ void DWARFContext::parseCompileUnits() { } void DWARFContext::parseTypeUnits() { - const TypeSectionMap &Sections = getTypesSections(); - for (TypeSectionMap::const_iterator I = Sections.begin(), E = Sections.end(); + const std::map<object::SectionRef, Section> &Sections = getTypesSections(); + for (std::map<object::SectionRef, Section>::const_iterator + I = Sections.begin(), + E = Sections.end(); I != E; ++I) { uint32_t offset = 0; const DataExtractor &DIData = diff --git a/lib/DebugInfo/DWARFContext.h b/lib/DebugInfo/DWARFContext.h index 08006d0d5e..03863ab8b1 100644 --- a/lib/DebugInfo/DWARFContext.h +++ b/lib/DebugInfo/DWARFContext.h @@ -19,7 +19,6 @@ #include "DWARFTypeUnit.h" #include "llvm/ADT/OwningPtr.h" #include "llvm/ADT/SmallVector.h" -#include "llvm/ADT/MapVector.h" #include "llvm/DebugInfo/DIContext.h" namespace llvm { @@ -139,9 +138,7 @@ public: virtual bool isLittleEndian() const = 0; virtual uint8_t getAddressSize() const = 0; virtual const Section &getInfoSection() = 0; - typedef MapVector<object::SectionRef, Section, - std::map<object::SectionRef, unsigned> > TypeSectionMap; - virtual const TypeSectionMap &getTypesSections() = 0; + virtual const std::map<object::SectionRef, Section> &getTypesSections() = 0; virtual StringRef getAbbrevSection() = 0; virtual const Section &getLocSection() = 0; virtual StringRef getARangeSection() = 0; @@ -182,7 +179,7 @@ class DWARFContextInMemory : public DWARFContext { bool IsLittleEndian; uint8_t AddressSize; Section InfoSection; - TypeSectionMap TypesSections; + std::map<object::SectionRef, Section> TypesSections; StringRef AbbrevSection; Section LocSection; StringRef ARangeSection; @@ -211,7 +208,9 @@ public: virtual bool isLittleEndian() const { return IsLittleEndian; } virtual uint8_t getAddressSize() const { return AddressSize; } virtual const Section &getInfoSection() { return InfoSection; } - virtual const TypeSectionMap &getTypesSections() { return TypesSections; } + virtual const std::map<object::SectionRef, Section> &getTypesSections() { + return TypesSections; + } virtual StringRef getAbbrevSection() { return AbbrevSection; } virtual const Section &getLocSection() { return LocSection; } virtual StringRef getARangeSection() { return ARangeSection; } diff --git a/lib/MC/MCObjectFileInfo.cpp b/lib/MC/MCObjectFileInfo.cpp index da70728247..8ef4a0a6d7 100644 --- a/lib/MC/MCObjectFileInfo.cpp +++ b/lib/MC/MCObjectFileInfo.cpp @@ -9,7 +9,6 @@ #include "llvm/MC/MCObjectFileInfo.h" #include "llvm/ADT/Triple.h" -#include "llvm/ADT/StringExtras.h" #include "llvm/MC/MCContext.h" #include "llvm/MC/MCSection.h" #include "llvm/MC/MCSectionCOFF.h" @@ -719,17 +718,6 @@ void MCObjectFileInfo::InitMCObjectFileInfo(StringRef TT, Reloc::Model relocm, } } -const MCSection *MCObjectFileInfo::getDwarfTypesSection(uint64_t Hash) const { - return Ctx->getELFSection(".debug_types", ELF::SHT_PROGBITS, ELF::SHF_GROUP, - SectionKind::getMetadata(), 0, utostr(Hash)); -} - -const MCSection * -MCObjectFileInfo::getDwarfTypesDWOSection(uint64_t Hash) const { - return Ctx->getELFSection(".debug_types.dwo", ELF::SHT_GROUP, 0, - SectionKind::getMetadata(), 0, utostr(Hash)); -} - void MCObjectFileInfo::InitEHFrameSection() { if (Env == IsMachO) EHFrameSection = |