add a new hook to allow targets to splat stuff at the end of the file.
authorChris Lattner <sabre@nondot.org>
Fri, 18 Sep 2009 20:17:03 +0000 (20:17 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 18 Sep 2009 20:17:03 +0000 (20:17 +0000)
Overriding doFinalization is pretty lame.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82268 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/AsmPrinter.h
lib/CodeGen/AsmPrinter/AsmPrinter.cpp

index a1765c4c2523238cd31f380e4d7de704218cf5f2..84d0a438e54e00cec817c9a89595d42b83cbbfe8 100644 (file)
@@ -169,6 +169,10 @@ namespace llvm {
     /// call this implementation.
     bool doInitialization(Module &M);
 
+    /// EmitEndOfAsmFile - This virtual method can be overridden by targets that
+    /// want to emit something at the end of their file.
+    virtual void EmitEndOfAsmFile(Module &M) {}
+    
     /// doFinalization - Shut down the asmprinter.  If you override this in your
     /// pass, you must make sure to call it explicitly.
     bool doFinalization(Module &M);
index e29bff5f66ae2d00bce615b3a91bce9787672f49..dec78a398fa64aa3ce34d0251a3748dc93c56b7c 100644 (file)
@@ -208,6 +208,11 @@ bool AsmPrinter::doFinalization(Module &M) {
     if (MAI->getNonexecutableStackDirective())
       O << MAI->getNonexecutableStackDirective() << '\n';
 
+  
+  // Allow the target to emit any magic that it wants at the end of the file,
+  // after everything else has gone out.
+  EmitEndOfAsmFile(M);
+  
   delete Mang; Mang = 0;
   DW = 0; MMI = 0;