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.
Recommitted as r197197 to reproduce the failure and reverted as r197199

Turns out there was unstable ordering in the type unit dumping code.
Fixed by using MapVector in DWARFContext to store the debug_types
comdat sections.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197210 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Blaikie
2013-12-13 06:27:38 +00:00
parent da44c36d64
commit bc6b250c74
10 changed files with 98 additions and 33 deletions

View File

@ -297,10 +297,8 @@ void DWARFContext::parseCompileUnits() {
}
void DWARFContext::parseTypeUnits() {
const std::map<object::SectionRef, Section> &Sections = getTypesSections();
for (std::map<object::SectionRef, Section>::const_iterator
I = Sections.begin(),
E = Sections.end();
const TypeSectionMap &Sections = getTypesSections();
for (TypeSectionMap::const_iterator I = Sections.begin(), E = Sections.end();
I != E; ++I) {
uint32_t offset = 0;
const DataExtractor &DIData =

View File

@ -19,6 +19,7 @@
#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 {
@ -138,7 +139,9 @@ public:
virtual bool isLittleEndian() const = 0;
virtual uint8_t getAddressSize() const = 0;
virtual const Section &getInfoSection() = 0;
virtual const std::map<object::SectionRef, Section> &getTypesSections() = 0;
typedef MapVector<object::SectionRef, Section,
std::map<object::SectionRef, unsigned> > TypeSectionMap;
virtual const TypeSectionMap &getTypesSections() = 0;
virtual StringRef getAbbrevSection() = 0;
virtual const Section &getLocSection() = 0;
virtual StringRef getARangeSection() = 0;
@ -179,7 +182,7 @@ class DWARFContextInMemory : public DWARFContext {
bool IsLittleEndian;
uint8_t AddressSize;
Section InfoSection;
std::map<object::SectionRef, Section> TypesSections;
TypeSectionMap TypesSections;
StringRef AbbrevSection;
Section LocSection;
StringRef ARangeSection;
@ -208,9 +211,7 @@ public:
virtual bool isLittleEndian() const { return IsLittleEndian; }
virtual uint8_t getAddressSize() const { return AddressSize; }
virtual const Section &getInfoSection() { return InfoSection; }
virtual const std::map<object::SectionRef, Section> &getTypesSections() {
return TypesSections;
}
virtual const TypeSectionMap &getTypesSections() { return TypesSections; }
virtual StringRef getAbbrevSection() { return AbbrevSection; }
virtual const Section &getLocSection() { return LocSection; }
virtual StringRef getARangeSection() { return ARangeSection; }