[PATCH] D41920: [DWARF][NFC] Prep for upcoming DWARF v5 string offsets table producer patch.
Wolfgang Pieb via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 10 18:36:25 PST 2018
This revision was automatically updated to reflect the committed changes.
wolfgangp marked an inline comment as done.
Closed by commit rL322250: [DWARF][NFC] Overload AsmPrinter::emitDwarfStringOffsets() to take a… (authored by wolfgangp, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D41920?vs=129347&id=129389#toc
Repository:
rL LLVM
https://reviews.llvm.org/D41920
Files:
llvm/trunk/include/llvm/CodeGen/AsmPrinter.h
llvm/trunk/include/llvm/CodeGen/DwarfStringPoolEntry.h
llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp
Index: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp
===================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp
+++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp
@@ -167,14 +167,15 @@
EmitLabelDifference(Label, Label->getSection().getBeginSymbol(), 4);
}
-void AsmPrinter::emitDwarfStringOffset(DwarfStringPoolEntryRef S) const {
+void AsmPrinter::emitDwarfStringOffset(DwarfStringPoolEntry S) const {
if (MAI->doesDwarfUseRelocationsAcrossSections()) {
- emitDwarfSymbolReference(S.getSymbol());
+ assert(S.Symbol && "No symbol available");
+ emitDwarfSymbolReference(S.Symbol);
return;
}
// Just emit the offset directly; no need for symbol math.
- EmitInt32(S.getOffset());
+ EmitInt32(S.Offset);
}
//===----------------------------------------------------------------------===//
Index: llvm/trunk/include/llvm/CodeGen/AsmPrinter.h
===================================================================
--- llvm/trunk/include/llvm/CodeGen/AsmPrinter.h
+++ llvm/trunk/include/llvm/CodeGen/AsmPrinter.h
@@ -508,7 +508,12 @@
/// When possible, emit a DwarfStringPool section offset without any
/// relocations, and without using the symbol. Otherwise, defers to \a
/// emitDwarfSymbolReference().
- void emitDwarfStringOffset(DwarfStringPoolEntryRef S) const;
+ void emitDwarfStringOffset(DwarfStringPoolEntry S) const;
+
+ /// Emit the 4-byte offset of a string from the start of its section.
+ void emitDwarfStringOffset(DwarfStringPoolEntryRef S) const {
+ emitDwarfStringOffset(S.getEntry());
+ }
/// Get the value for DW_AT_APPLE_isa. Zero if no isa encoding specified.
virtual unsigned getISAEncoding() { return 0; }
Index: llvm/trunk/include/llvm/CodeGen/DwarfStringPoolEntry.h
===================================================================
--- llvm/trunk/include/llvm/CodeGen/DwarfStringPoolEntry.h
+++ llvm/trunk/include/llvm/CodeGen/DwarfStringPoolEntry.h
@@ -41,6 +41,8 @@
unsigned getOffset() const { return I->second.Offset; }
unsigned getIndex() const { return I->second.Index; }
StringRef getString() const { return I->first(); }
+ /// Return the entire string pool entry for convenience.
+ DwarfStringPoolEntry getEntry() const { return I->getValue(); }
bool operator==(const DwarfStringPoolEntryRef &X) const { return I == X.I; }
bool operator!=(const DwarfStringPoolEntryRef &X) const { return I != X.I; }
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D41920.129389.patch
Type: text/x-patch
Size: 2491 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180111/67940eb8/attachment.bin>
More information about the llvm-commits
mailing list