summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2014-05-21 23:27:41 +0000
committerDavid Blaikie <dblaikie@gmail.com>2014-05-21 23:27:41 +0000
commit8a0240ddf2ed2ebec6fbeaba18a69e19b0abd7b5 (patch)
tree9f42736722188dd32728936bea99ce5098f139e0
parentcba7ac7bda58e03d452f7e8ad73978744c101727 (diff)
downloadllvm-8a0240ddf2ed2ebec6fbeaba18a69e19b0abd7b5.tar.gz
llvm-8a0240ddf2ed2ebec6fbeaba18a69e19b0abd7b5.tar.bz2
llvm-8a0240ddf2ed2ebec6fbeaba18a69e19b0abd7b5.tar.xz
Revert "DebugInfo: Don't put fission type units in comdat sections."
This reverts commit r208930, r208933, and r208975. It seems not all fission consumers are ready to handle this behavior. Reverting until tools are brought up to spec. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209338 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/MC/MCObjectFileInfo.h5
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfDebug.cpp24
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfDebug.h1
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfUnit.h4
-rw-r--r--lib/MC/MCObjectFileInfo.cpp14
-rw-r--r--test/DebugInfo/X86/generate-odr-hash.ll20
6 files changed, 20 insertions, 48 deletions
diff --git a/include/llvm/MC/MCObjectFileInfo.h b/include/llvm/MC/MCObjectFileInfo.h
index 58f37d437c..1a56040e46 100644
--- a/include/llvm/MC/MCObjectFileInfo.h
+++ b/include/llvm/MC/MCObjectFileInfo.h
@@ -122,7 +122,6 @@ protected:
/// These are used for the Fission separate debug information files.
const MCSection *DwarfInfoDWOSection;
- const MCSection *DwarfTypesDWOSection;
const MCSection *DwarfAbbrevDWOSection;
const MCSection *DwarfStrDWOSection;
const MCSection *DwarfLineDWOSection;
@@ -271,9 +270,7 @@ public:
return DwarfInfoDWOSection;
}
const MCSection *getDwarfTypesSection(uint64_t Hash) const;
- const MCSection *getDwarfTypesDWOSection() const {
- return DwarfTypesDWOSection;
- }
+ const MCSection *getDwarfTypesDWOSection(uint64_t Hash) const;
const MCSection *getDwarfAbbrevDWOSection() const {
return DwarfAbbrevDWOSection;
}
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 745b2f0432..4a317cf0b5 100644
--- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -1588,12 +1588,9 @@ void DwarfDebug::emitSectionLabels() {
// Dwarf sections base addresses.
DwarfInfoSectionSym =
emitSectionSym(Asm, TLOF.getDwarfInfoSection(), "section_info");
- if (useSplitDwarf()) {
+ if (useSplitDwarf())
DwarfInfoDWOSectionSym =
emitSectionSym(Asm, TLOF.getDwarfInfoDWOSection(), "section_info_dwo");
- DwarfTypesDWOSectionSym =
- emitSectionSym(Asm, TLOF.getDwarfTypesDWOSection(), "section_types_dwo");
- }
DwarfAbbrevSectionSym =
emitSectionSym(Asm, TLOF.getDwarfAbbrevSection(), "section_abbrev");
if (useSplitDwarf())
@@ -2357,9 +2354,9 @@ void DwarfDebug::addDwarfTypeUnitType(DwarfCompileUnit &CU,
bool TopLevelType = TypeUnitsUnderConstruction.empty();
AddrPool.resetUsedFlag();
- auto OwnedUnit = make_unique<DwarfTypeUnit>(
- InfoHolder.getUnits().size() + TypeUnitsUnderConstruction.size(), CU, Asm,
- this, &InfoHolder, getDwoLineTable(CU));
+ auto OwnedUnit =
+ make_unique<DwarfTypeUnit>(InfoHolder.getUnits().size(), CU, Asm, this,
+ &InfoHolder, getDwoLineTable(CU));
DwarfTypeUnit &NewTU = *OwnedUnit;
DIE &UnitDie = NewTU.getUnitDie();
TU = &NewTU;
@@ -2372,14 +2369,13 @@ void DwarfDebug::addDwarfTypeUnitType(DwarfCompileUnit &CU,
uint64_t Signature = makeTypeSignature(Identifier);
NewTU.setTypeSignature(Signature);
- if (useSplitDwarf())
- NewTU.initSection(Asm->getObjFileLowering().getDwarfTypesDWOSection(),
- DwarfTypesDWOSectionSym);
- else {
+ if (!useSplitDwarf())
CU.applyStmtList(UnitDie);
- NewTU.initSection(
- Asm->getObjFileLowering().getDwarfTypesSection(Signature));
- }
+
+ NewTU.initSection(
+ useSplitDwarf()
+ ? Asm->getObjFileLowering().getDwarfTypesDWOSection(Signature)
+ : Asm->getObjFileLowering().getDwarfTypesSection(Signature));
NewTU.setType(NewTU.createTypeDIE(CTy));
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.h b/lib/CodeGen/AsmPrinter/DwarfDebug.h
index aa18e7c345..1b0b1ebafd 100644
--- a/lib/CodeGen/AsmPrinter/DwarfDebug.h
+++ b/lib/CodeGen/AsmPrinter/DwarfDebug.h
@@ -253,7 +253,6 @@ class DwarfDebug : public AsmPrinterHandler {
MCSymbol *DwarfDebugLocSectionSym, *DwarfLineSectionSym, *DwarfAddrSectionSym;
MCSymbol *FunctionBeginSym, *FunctionEndSym;
MCSymbol *DwarfInfoDWOSectionSym, *DwarfAbbrevDWOSectionSym;
- MCSymbol *DwarfTypesDWOSectionSym;
MCSymbol *DwarfStrDWOSectionSym;
MCSymbol *DwarfGnuPubNamesSectionSym, *DwarfGnuPubTypesSectionSym;
diff --git a/lib/CodeGen/AsmPrinter/DwarfUnit.h b/lib/CodeGen/AsmPrinter/DwarfUnit.h
index 7893148798..e44f256c3a 100644
--- a/lib/CodeGen/AsmPrinter/DwarfUnit.h
+++ b/lib/CodeGen/AsmPrinter/DwarfUnit.h
@@ -577,10 +577,6 @@ public:
sizeof(uint32_t); // Type DIE Offset
}
void initSection(const MCSection *Section);
- // Bring in the base function (taking two args, including the section symbol)
- // for use when building DWO type units (they don't go in unique comdat
- // sections)
- using DwarfUnit::initSection;
DwarfCompileUnit &getCU() override { return CU; }
protected:
diff --git a/lib/MC/MCObjectFileInfo.cpp b/lib/MC/MCObjectFileInfo.cpp
index e5377890da..bb13279950 100644
--- a/lib/MC/MCObjectFileInfo.cpp
+++ b/lib/MC/MCObjectFileInfo.cpp
@@ -537,9 +537,6 @@ void MCObjectFileInfo::InitELFMCObjectFileInfo(Triple T) {
DwarfInfoDWOSection =
Ctx->getELFSection(".debug_info.dwo", ELF::SHT_PROGBITS, 0,
SectionKind::getMetadata());
- DwarfTypesDWOSection =
- Ctx->getELFSection(".debug_types.dwo", ELF::SHT_PROGBITS, 0,
- SectionKind::getMetadata());
DwarfAbbrevDWOSection =
Ctx->getELFSection(".debug_abbrev.dwo", ELF::SHT_PROGBITS, 0,
SectionKind::getMetadata());
@@ -709,10 +706,6 @@ void MCObjectFileInfo::InitCOFFMCObjectFileInfo(Triple T) {
Ctx->getCOFFSection(".debug_info.dwo", COFF::IMAGE_SCN_MEM_DISCARDABLE |
COFF::IMAGE_SCN_MEM_READ,
SectionKind::getMetadata());
- DwarfTypesDWOSection =
- Ctx->getCOFFSection(".debug_types.dwo", COFF::IMAGE_SCN_MEM_DISCARDABLE |
- COFF::IMAGE_SCN_MEM_READ,
- SectionKind::getMetadata());
DwarfAbbrevDWOSection =
Ctx->getCOFFSection(".debug_abbrev.dwo", COFF::IMAGE_SCN_MEM_DISCARDABLE |
COFF::IMAGE_SCN_MEM_READ,
@@ -814,6 +807,13 @@ const MCSection *MCObjectFileInfo::getDwarfTypesSection(uint64_t Hash) const {
SectionKind::getMetadata(), 0, utostr(Hash));
}
+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));
+}
+
void MCObjectFileInfo::InitEHFrameSection() {
if (Env == IsMachO)
EHFrameSection =
diff --git a/test/DebugInfo/X86/generate-odr-hash.ll b/test/DebugInfo/X86/generate-odr-hash.ll
index 7f4c99de2f..e713f14c4f 100644
--- a/test/DebugInfo/X86/generate-odr-hash.ll
+++ b/test/DebugInfo/X86/generate-odr-hash.ll
@@ -1,12 +1,10 @@
; REQUIRES: object-emission
-; RUN: llc < %s -o %t -filetype=obj -O0 -generate-type-units -mtriple=x86_64-unknown-linux-gnu
+; RUN: llc %s -o %t -filetype=obj -O0 -generate-type-units -mtriple=x86_64-unknown-linux-gnu
; RUN: llvm-dwarfdump %t | FileCheck --check-prefix=CHECK --check-prefix=SINGLE %s
-; RUN: llvm-readobj -s -t %t | FileCheck --check-prefix=OBJ_COMMON %s
-; RUN: llc < %s -split-dwarf=Enable -o %t -filetype=obj -O0 -generate-type-units -mtriple=x86_64-unknown-linux-gnu
+; RUN: llc %s -split-dwarf=Enable -o %t -filetype=obj -O0 -generate-type-units -mtriple=x86_64-unknown-linux-gnu
; RUN: llvm-dwarfdump %t | FileCheck --check-prefix=CHECK --check-prefix=FISSION %s
-; RUN: llvm-readobj -s -t %t | FileCheck --check-prefix=OBJ_COMMON --check-prefix=OBJ_FISSION %s
; Generated from bar.cpp:
@@ -163,20 +161,6 @@
; CHECK-NEXT: [[FLUFFY]] "echidna::capybara::mongoose::fluffy"
; CHECK-NEXT: [[WALRUS]] "walrus"
-; Make sure debug_types are in comdat groups. This could be more rigid to check
-; that they're the right comdat groups (each type in a separate comdat group,
-; etc)
-; OBJ_COMMON: Name: .debug_types (
-; OBJ_COMMON-NOT: }
-; OBJ_COMMON: SHF_GROUP
-
-; Fission type units don't go in comdat groups, since their linker is debug
-; aware it's handled using the debug info semantics rather than raw ELF object
-; semantics.
-; OBJ_FISSION: Name: .debug_types.dwo (
-; OBJ_FISSION-NOT: SHF_GROUP
-; OBJ_FISSION: }
-
%struct.bar = type { i8 }
%"class.echidna::capybara::mongoose::fluffy" = type { i32, i32 }
%"struct.<anonymous namespace>::walrus" = type { i8 }