aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-11-01 00:12:36 +0000
committerChris Lattner <sabre@nondot.org>2005-11-01 00:12:36 +0000
commit5b0ac99c9690d7534ade82848c207e202883831b (patch)
treeaa21648c8aa3b3cc076882754691321edc2b40e7
parentbb69e39b5b8ddf7243e2b77cebe2f9f23ba819b2 (diff)
Add a flag to enable a darwin linker optimization
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24130 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/PowerPC/PPCAsmPrinter.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp
index e4cfd63aa3..4d97ef3a9e 100644
--- a/lib/Target/PowerPC/PPCAsmPrinter.cpp
+++ b/lib/Target/PowerPC/PPCAsmPrinter.cpp
@@ -567,6 +567,13 @@ bool DarwinAsmPrinter::doFinalization(Module &M) {
<< "\t.long\t" << *i << '\n';
}
+ // Funny Darwin hack: This flag tells the linker that no global symbols
+ // contain code that falls through to other global symbols (e.g. the obvious
+ // implementation of multiple entry points). If this doesn't occur, the
+ // linker can safely perform dead code stripping. Since LLVM never generates
+ // code that does this, it is always safe to set.
+ O << "\t.subsections_via_symbols\n";
+
AsmPrinter::doFinalization(M);
return false; // success
}
@@ -711,7 +718,6 @@ bool AIXAsmPrinter::doFinalization(Module &M) {
O << "_section_.text:\n"
<< "\t.csect .data[RW],3\n"
<< "\t.llong _section_.text\n";
-
delete Mang;
return false; // success
}