summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorPavel Labath <labath@google.com>2018-07-25 16:34:43 +0000
committerPavel Labath <labath@google.com>2018-07-25 16:34:43 +0000
commitda3c4fb5fec193366a442bf6240ace83e7541e66 (patch)
treeaf1643a540d800cd02e806886d3658e324b3c0d6 /llvm/lib/CodeGen
parent4e07509d18f17b5ea387d2ddc16381ccb316927b (diff)
downloadbcm5719-llvm-da3c4fb5fec193366a442bf6240ace83e7541e66.tar.gz
bcm5719-llvm-da3c4fb5fec193366a442bf6240ace83e7541e66.zip
Revert "dwarfgen: Add support for generating the debug_str_offsets section, take 2"
This reverts commit r337933. The build error is fixed but the test now fails on the darwin buildbots. Investigating... llvm-svn: 337935
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp10
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfFile.cpp20
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfFile.h3
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfStringPool.cpp22
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfStringPool.h4
5 files changed, 27 insertions, 32 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index d2f123ce78e..f1e61b488a2 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -1506,9 +1506,8 @@ void DwarfDebug::emitAbbreviations() {
void DwarfDebug::emitStringOffsetsTableHeader() {
DwarfFile &Holder = useSplitDwarf() ? SkeletonHolder : InfoHolder;
- Holder.getStringPool().emitStringOffsetsTableHeader(
- *Asm, Asm->getObjFileLowering().getDwarfStrOffSection(),
- Holder.getStringOffsetsStartSym());
+ Holder.emitStringOffsetsTableHeader(
+ Asm->getObjFileLowering().getDwarfStrOffSection());
}
template <typename AccelTableT>
@@ -2293,9 +2292,8 @@ void DwarfDebug::emitDebugLineDWO() {
void DwarfDebug::emitStringOffsetsTableHeaderDWO() {
assert(useSplitDwarf() && "No split dwarf?");
- InfoHolder.getStringPool().emitStringOffsetsTableHeader(
- *Asm, Asm->getObjFileLowering().getDwarfStrOffDWOSection(),
- InfoHolder.getStringOffsetsStartSym());
+ InfoHolder.emitStringOffsetsTableHeader(
+ Asm->getObjFileLowering().getDwarfStrOffDWOSection());
}
// Emit the .debug_str.dwo section for separated dwarf. This contains the
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfFile.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfFile.cpp
index c90bd568162..f3a3cbdbc74 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfFile.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfFile.cpp
@@ -28,6 +28,26 @@ void DwarfFile::addUnit(std::unique_ptr<DwarfCompileUnit> U) {
CUs.push_back(std::move(U));
}
+void DwarfFile::emitStringOffsetsTableHeader(MCSection *Section) {
+ if (StrPool.empty())
+ return;
+ Asm->OutStreamer->SwitchSection(Section);
+ unsigned EntrySize = 4;
+ // FIXME: DWARF64
+ // We are emitting the header for a contribution to the string offsets
+ // table. The header consists of an entry with the contribution's
+ // size (not including the size of the length field), the DWARF version and
+ // 2 bytes of padding.
+ Asm->emitInt32(StrPool.size() * EntrySize + 4);
+ Asm->emitInt16(Asm->getDwarfVersion());
+ Asm->emitInt16(0);
+ // Define the symbol that marks the start of the contribution. It is
+ // referenced by most unit headers via DW_AT_str_offsets_base.
+ // Split units do not use the attribute.
+ if (StringOffsetsStartSym)
+ Asm->OutStreamer->EmitLabel(StringOffsetsStartSym);
+}
+
// Emit the various dwarf units to the unit section USection with
// the abbreviations going into ASection.
void DwarfFile::emitUnits(bool UseOffsets) {
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfFile.h b/llvm/lib/CodeGen/AsmPrinter/DwarfFile.h
index 8dfbc4e1c43..272a26851b7 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfFile.h
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfFile.h
@@ -91,6 +91,9 @@ public:
/// Add a unit to the list of CUs.
void addUnit(std::unique_ptr<DwarfCompileUnit> U);
+ /// Emit the string table offsets header.
+ void emitStringOffsetsTableHeader(MCSection *Section);
+
/// Emit all of the units to the section listed with the given
/// abbreviation section.
void emitUnits(bool UseOffsets);
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfStringPool.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfStringPool.cpp
index a61fa83cfb0..f2964673a6b 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfStringPool.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfStringPool.cpp
@@ -39,28 +39,6 @@ DwarfStringPool::EntryRef DwarfStringPool::getEntry(AsmPrinter &Asm,
return EntryRef(*I.first);
}
-void DwarfStringPool::emitStringOffsetsTableHeader(AsmPrinter &Asm,
- MCSection *Section,
- MCSymbol *StartSym) {
- if (empty())
- return;
- Asm.OutStreamer->SwitchSection(Section);
- unsigned EntrySize = 4;
- // FIXME: DWARF64
- // We are emitting the header for a contribution to the string offsets
- // table. The header consists of an entry with the contribution's
- // size (not including the size of the length field), the DWARF version and
- // 2 bytes of padding.
- Asm.emitInt32(size() * EntrySize + 4);
- Asm.emitInt16(Asm.getDwarfVersion());
- Asm.emitInt16(0);
- // Define the symbol that marks the start of the contribution. It is
- // referenced by most unit headers via DW_AT_str_offsets_base.
- // Split units do not use the attribute.
- if (StartSym)
- Asm.OutStreamer->EmitLabel(StartSym);
-}
-
void DwarfStringPool::emit(AsmPrinter &Asm, MCSection *StrSection,
MCSection *OffsetSection, bool UseRelativeOffsets) {
if (Pool.empty())
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfStringPool.h b/llvm/lib/CodeGen/AsmPrinter/DwarfStringPool.h
index 6e6988ea4ad..069c124d1a7 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfStringPool.h
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfStringPool.h
@@ -19,7 +19,6 @@ namespace llvm {
class AsmPrinter;
class MCSection;
-class MCSymbol;
// Collection of strings for this unit and assorted symbols.
// A String->Symbol mapping of strings used by indirect
@@ -37,9 +36,6 @@ public:
DwarfStringPool(BumpPtrAllocator &A, AsmPrinter &Asm, StringRef Prefix);
- void emitStringOffsetsTableHeader(AsmPrinter &Asm, MCSection *OffsetSection,
- MCSymbol *StartSym);
-
void emit(AsmPrinter &Asm, MCSection *StrSection,
MCSection *OffsetSection = nullptr,
bool UseRelativeOffsets = false);
OpenPOWER on IntegriCloud