[MCAssembler] Allow backend to finalize layout post-relaxation.
authorColin LeMahieu <colinl@codeaurora.org>
Wed, 27 Apr 2016 21:26:13 +0000 (21:26 +0000)
committerColin LeMahieu <colinl@codeaurora.org>
Wed, 27 Apr 2016 21:26:13 +0000 (21:26 +0000)
Differential revision: http://reviews.llvm.org/D19429

llvm-svn: 267796

llvm/include/llvm/MC/MCAsmBackend.h
llvm/lib/MC/MCAssembler.cpp

index 40ff8e3..a4d7348 100644 (file)
@@ -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) {}
 
index ca8ccb4..4bb0dda 100644 (file)
@@ -914,4 +914,5 @@ void MCAssembler::finishLayout(MCAsmLayout &Layout) {
   for (unsigned int i = 0, n = Layout.getSectionOrder().size(); i != n; ++i) {
     Layout.getFragmentOffset(&*Layout.getSectionOrder()[i]->rbegin());
   }
+  getBackend().finishLayout(*this, Layout);
 }