[llvm] r267796 - [MCAssembler] Allow backend to finalize layout post-relaxation.

Colin LeMahieu via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 27 14:26:14 PDT 2016


Author: colinl
Date: Wed Apr 27 16:26:13 2016
New Revision: 267796

URL: http://llvm.org/viewvc/llvm-project?rev=267796&view=rev
Log:
[MCAssembler] Allow backend to finalize layout post-relaxation.

Differential revision: http://reviews.llvm.org/D19429

Modified:
    llvm/trunk/include/llvm/MC/MCAsmBackend.h
    llvm/trunk/lib/MC/MCAssembler.cpp

Modified: llvm/trunk/include/llvm/MC/MCAsmBackend.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCAsmBackend.h?rev=267796&r1=267795&r2=267796&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCAsmBackend.h (original)
+++ llvm/trunk/include/llvm/MC/MCAsmBackend.h Wed Apr 27 16:26:13 2016
@@ -126,6 +126,10 @@ public:
   /// \return - True on success.
   virtual bool writeNopData(uint64_t Count, MCObjectWriter *OW) const = 0;
 
+  /// Give backend an opportunity to finish layout after relaxation
+  virtual void finishLayout(MCAssembler const &Asm,
+                            MCAsmLayout &Layout) const {}
+
   /// Handle any target-specific assembler flags. By default, do nothing.
   virtual void handleAssemblerFlag(MCAssemblerFlag Flag) {}
 

Modified: llvm/trunk/lib/MC/MCAssembler.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAssembler.cpp?rev=267796&r1=267795&r2=267796&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCAssembler.cpp (original)
+++ llvm/trunk/lib/MC/MCAssembler.cpp Wed Apr 27 16:26:13 2016
@@ -914,4 +914,5 @@ void MCAssembler::finishLayout(MCAsmLayo
   for (unsigned int i = 0, n = Layout.getSectionOrder().size(); i != n; ++i) {
     Layout.getFragmentOffset(&*Layout.getSectionOrder()[i]->rbegin());
   }
+  getBackend().finishLayout(*this, Layout);
 }




More information about the llvm-commits mailing list