[PATCH] D49131: [MC] Add interface to finish pending labels.
Jonas Devlieghere via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 10 07:29:20 PDT 2018
JDevlieghere updated this revision to Diff 154803.
JDevlieghere added a comment.
- Add comment
https://reviews.llvm.org/D49131
Files:
llvm/include/llvm/MC/MCObjectStreamer.h
llvm/lib/MC/MCObjectStreamer.cpp
llvm/tools/dsymutil/MachOUtils.cpp
Index: llvm/tools/dsymutil/MachOUtils.cpp
===================================================================
--- llvm/tools/dsymutil/MachOUtils.cpp
+++ llvm/tools/dsymutil/MachOUtils.cpp
@@ -322,8 +322,10 @@
auto &ObjectStreamer = static_cast<MCObjectStreamer &>(MS);
MCAssembler &MCAsm = ObjectStreamer.getAssembler();
auto &Writer = static_cast<MachObjectWriter &>(MCAsm.getWriter());
- MCAsmLayout Layout(MCAsm);
+ // Finish but don't emit.
+ ObjectStreamer.finishPendingLabels();
+ MCAsmLayout Layout(MCAsm);
MCAsm.layout(Layout);
BinaryHolder InputBinaryHolder(false);
Index: llvm/lib/MC/MCObjectStreamer.cpp
===================================================================
--- llvm/lib/MC/MCObjectStreamer.cpp
+++ llvm/lib/MC/MCObjectStreamer.cpp
@@ -668,6 +668,6 @@
// Dump out the dwarf file & directory tables and line tables.
MCDwarfLineTable::Emit(this, getAssembler().getDWARFLinetableParams());
- flushPendingLabels(nullptr);
+ flushPendingLabels();
getAssembler().Finish();
}
Index: llvm/include/llvm/MC/MCObjectStreamer.h
===================================================================
--- llvm/include/llvm/MC/MCObjectStreamer.h
+++ llvm/include/llvm/MC/MCObjectStreamer.h
@@ -90,6 +90,9 @@
public:
void visitUsedSymbol(const MCSymbol &Sym) override;
+ /// Create a dummy fragment to assign any pending labels.
+ void flushPendingLabels() { flushPendingLabels(nullptr); }
+
MCAssembler &getAssembler() { return *Assembler; }
MCAssembler *getAssemblerPtr() override;
/// \name MCStreamer Interface
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D49131.154803.patch
Type: text/x-patch
Size: 1575 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180710/11ad4d9f/attachment.bin>
More information about the llvm-commits
mailing list