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 | a65530a04a5ad39718ea0ac848a7d329117a1b2f (patch) | |
tree | f42654f8d9d6b2d0310b31500cedd1a0f93e05bb /lib/CodeGen/AsmPrinter.cpp | |
parent | 4fbf00ba28ee2163b6aaece9bca4dffed3167f07 (diff) | |
download | external_llvm-a65530a04a5ad39718ea0ac848a7d329117a1b2f.zip external_llvm-a65530a04a5ad39718ea0ac848a7d329117a1b2f.tar.gz external_llvm-a65530a04a5ad39718ea0ac848a7d329117a1b2f.tar.bz2 |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50634 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/AsmPrinter.cpp')
-rw-r--r-- | lib/CodeGen/AsmPrinter.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/CodeGen/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter.cpp index 65b8c43..9c4e789 100644 --- a/lib/CodeGen/AsmPrinter.cpp +++ b/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; } |