diff options
author | Chris Lattner <sabre@nondot.org> | 2009-09-18 20:17:03 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-09-18 20:17:03 +0000 |
commit | bd23d5fda85e38c88dfa668a99777cd05c524822 (patch) | |
tree | eef8fce9a7047091da6319a75875788892e47741 | |
parent | 8dffc819c5f4326700262e7d1ff906d0d44ca906 (diff) |
add a new hook to allow targets to splat stuff at the end of the file.
Overriding doFinalization is pretty lame.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82268 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/CodeGen/AsmPrinter.h | 4 | ||||
-rw-r--r-- | lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 5 |
2 files changed, 9 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/AsmPrinter.h b/include/llvm/CodeGen/AsmPrinter.h index a1765c4c25..84d0a438e5 100644 --- a/include/llvm/CodeGen/AsmPrinter.h +++ b/include/llvm/CodeGen/AsmPrinter.h @@ -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); diff --git a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index e29bff5f66..dec78a398f 100644 --- a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -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; |