aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2012-01-19 00:34:10 +0000
committerNick Lewycky <nicholas@mxc.ca>2012-01-19 00:34:10 +0000
commit22de16dc7582dac43429ce0dcb374604020c01f5 (patch)
treecdf90f822164c39bf7a6c99518381a49b0cbf7b7 /lib
parent9b159710ebe8a37cba38ca0c5b465e362bd68af7 (diff)
downloadexternal_llvm-22de16dc7582dac43429ce0dcb374604020c01f5.zip
external_llvm-22de16dc7582dac43429ce0dcb374604020c01f5.tar.gz
external_llvm-22de16dc7582dac43429ce0dcb374604020c01f5.tar.bz2
Add a TargetOption for disabling tail calls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148442 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Target/X86/X86ISelLowering.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp
index 91dc7b5..858ebc5 100644
--- a/lib/Target/X86/X86ISelLowering.cpp
+++ b/lib/Target/X86/X86ISelLowering.cpp
@@ -1732,7 +1732,7 @@ static bool IsTailCallConvention(CallingConv::ID CC) {
}
bool X86TargetLowering::mayBeEmittedAsTailCall(CallInst *CI) const {
- if (!CI->isTailCall())
+ if (!CI->isTailCall() || getTargetMachine().Options.DisableTailCalls)
return false;
CallSite CS(CI);
@@ -2133,6 +2133,9 @@ X86TargetLowering::LowerCall(SDValue Chain, SDValue Callee,
bool IsStructRet = CallIsStructReturn(Outs);
bool IsSibcall = false;
+ if (MF.getTarget().Options.DisableTailCalls)
+ isTailCall = false;
+
if (isTailCall) {
// Check if it's really possible to do a tail call.
isTailCall = IsEligibleForTailCallOptimization(Callee, CallConv,