diff options
| author | Dan Gohman <gohman@apple.com> | 2008-05-05 00:28:39 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2008-05-05 00:28:39 +0000 |
| commit | bcde17222280cc15c78903389a7f5a5eee31c0ec (patch) | |
| tree | 70d0e840cc36f67d375c83802b0409d22547adb2 /llvm/lib/CodeGen/AsmPrinter.cpp | |
| parent | de977c0a5c01403a20d9e55d4067cd1f67a6730d (diff) | |
| download | bcm5719-llvm-bcde17222280cc15c78903389a7f5a5eee31c0ec.tar.gz bcm5719-llvm-bcde17222280cc15c78903389a7f5a5eee31c0ec.zip | |
Add AsmPrinter support for emitting a directive to declare that
the code being generated does not require an executable stack.
Also, add target-specific code to make use of this on Linux
on x86.
llvm-svn: 50634
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/AsmPrinter.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter.cpp index 65b8c436f78..9c4e789251a 100644 --- a/llvm/lib/CodeGen/AsmPrinter.cpp +++ b/llvm/lib/CodeGen/AsmPrinter.cpp @@ -192,6 +192,13 @@ bool AsmPrinter::doFinalization(Module &M) { E = CMM->begin(); I != E; ) (*--I)->finishAssembly(O, *this, *TAI); + // If we don't have any trampolines, then we don't require stack memory + // to be executable. Some targets have a directive to declare this. + Function* InitTrampolineIntrinsic = M.getFunction("llvm.init.trampoline"); + if (!InitTrampolineIntrinsic || InitTrampolineIntrinsic->use_empty()) + if (TAI->getNonexecutableStackDirective()) + O << TAI->getNonexecutableStackDirective() << "\n"; + delete Mang; Mang = 0; return false; } |

