summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-01-27 07:21:55 +0000
committerChris Lattner <sabre@nondot.org>2010-01-27 07:21:55 +0000
commitbc1e6f08730159e7de2d5d8c5e48c96fe0146650 (patch)
tree270cd447f51a11bcf29330ce4e8bf3bd89f76f4d /llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
parentf99134f470532eb58d18583f8d90244ac40c03cc (diff)
downloadbcm5719-llvm-bc1e6f08730159e7de2d5d8c5e48c96fe0146650.tar.gz
bcm5719-llvm-bc1e6f08730159e7de2d5d8c5e48c96fe0146650.zip
add a new AsmPrinter::EmitFunctionEntryLabel virtual function,
which allows targets to override function entry label emission. Use it to convert linux/ppc to use EmitFunctionHeader(). llvm-svn: 94667
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index 8c9b0f1a898..fd29937eb0b 100644
--- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -313,8 +313,11 @@ void AsmPrinter::EmitFunctionHeader() {
/*PrintType=*/false, F->getParent());
OutStreamer.GetCommentOS() << '\n';
}
- OutStreamer.EmitLabel(CurrentFnSym);
+ // Emit the CurrentFnSym. This is is a virtual function to allow targets to
+ // do their wild and crazy things as required.
+ EmitFunctionEntryLabel();
+
// Add some workaround for linkonce linkage on Cygwin\MinGW.
if (MAI->getLinkOnceDirective() != 0 &&
(F->hasLinkOnceLinkage() || F->hasWeakLinkage()))
@@ -326,7 +329,11 @@ void AsmPrinter::EmitFunctionHeader() {
DW->BeginFunction(MF);
}
-
+/// EmitFunctionEntryLabel - Emit the label that is the entrypoint for the
+/// function. This can be overridden by targets as required to do custom stuff.
+void AsmPrinter::EmitFunctionEntryLabel() {
+ OutStreamer.EmitLabel(CurrentFnSym);
+}
bool AsmPrinter::doFinalization(Module &M) {
OpenPOWER on IntegriCloud