[llvm-commits] [llvm] r82268 - in /llvm/trunk: include/llvm/CodeGen/AsmPrinter.h lib/CodeGen/AsmPrinter/AsmPrinter.cpp
Chris Lattner
sabre at nondot.org
Fri Sep 18 13:17:03 PDT 2009
Author: lattner
Date: Fri Sep 18 15:17:03 2009
New Revision: 82268
URL: http://llvm.org/viewvc/llvm-project?rev=82268&view=rev
Log:
add a new hook to allow targets to splat stuff at the end of the file.
Overriding doFinalization is pretty lame.
Modified:
llvm/trunk/include/llvm/CodeGen/AsmPrinter.h
llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
Modified: llvm/trunk/include/llvm/CodeGen/AsmPrinter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/AsmPrinter.h?rev=82268&r1=82267&r2=82268&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/AsmPrinter.h (original)
+++ llvm/trunk/include/llvm/CodeGen/AsmPrinter.h Fri Sep 18 15:17:03 2009
@@ -169,6 +169,10 @@
/// 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);
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=82268&r1=82267&r2=82268&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Fri Sep 18 15:17:03 2009
@@ -208,6 +208,11 @@
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;
More information about the llvm-commits
mailing list