[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 08:37:22 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL336688: [MC] Add interface to finish pending labels. (authored by JDevlieghere, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D49131?vs=154805&id=154815#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D49131

Files:
  llvm/trunk/include/llvm/MC/MCObjectStreamer.h
  llvm/trunk/lib/MC/MCObjectStreamer.cpp
  llvm/trunk/tools/dsymutil/MachOUtils.cpp


Index: llvm/trunk/lib/MC/MCObjectStreamer.cpp
===================================================================
--- llvm/trunk/lib/MC/MCObjectStreamer.cpp
+++ llvm/trunk/lib/MC/MCObjectStreamer.cpp
@@ -671,6 +671,6 @@
   // Dump out the dwarf file & directory tables and line tables.
   MCDwarfLineTable::Emit(this, getAssembler().getDWARFLinetableParams());
 
-  flushPendingLabels(nullptr);
+  flushPendingLabels();
   getAssembler().Finish();
 }
Index: llvm/trunk/tools/dsymutil/MachOUtils.cpp
===================================================================
--- llvm/trunk/tools/dsymutil/MachOUtils.cpp
+++ llvm/trunk/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);
 
+  // Layout but don't emit.
+  ObjectStreamer.flushPendingLabels();
+  MCAsmLayout Layout(MCAsm);
   MCAsm.layout(Layout);
 
   BinaryHolder InputBinaryHolder(false);
Index: llvm/trunk/include/llvm/MC/MCObjectStreamer.h
===================================================================
--- llvm/trunk/include/llvm/MC/MCObjectStreamer.h
+++ llvm/trunk/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.154815.patch
Type: text/x-patch
Size: 1628 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180710/f0d60b58/attachment.bin>


More information about the llvm-commits mailing list