DebugInfo: Move type units into the debug_types section with appropriate comdat grouping and type unit headers

This commit does not complete the type units feature - there are issues
around fission support (skeletal type units, pubtypes/pubnames) and
hashing of some types including those containing references to types in
other type units.

Originally committed as r197073 and reverted in r197079.

This commit originally got jumbled up with another build-breaking commit
and I can't find the failures I thought this caused anymore.
Recommitting to hopefully get some clean buildbot results to work from.
I have a sneaking suspicion there's unstable output in the comdat group
output of MCStreamer...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197197 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Blaikie
2013-12-13 01:06:41 +00:00
parent 363c1ec574
commit f4597a0cd4
8 changed files with 93 additions and 29 deletions

View File

@@ -413,14 +413,15 @@ public:
/// Compute the size of a header for this unit, not including the initial
/// length field.
unsigned getHeaderSize() const {
virtual 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.
void emitHeader(const MCSection *ASection, const MCSymbol *ASectionSym) const;
virtual void emitHeader(const MCSection *ASection,
const MCSymbol *ASectionSym) const;
protected:
/// getOrCreateStaticMemberDIE - Create new static data member DIE.
@@ -513,12 +514,25 @@ 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