diff options
| author | Reid Kleckner <reid@kleckner.net> | 2014-08-29 21:25:28 +0000 |
|---|---|---|
| committer | Reid Kleckner <reid@kleckner.net> | 2014-08-29 21:25:28 +0000 |
| commit | 329d4a2b292ec19e2bb0eeb03889c7a6757e137d (patch) | |
| tree | 7281cef693a4fa6278ea9530254fc1fd12258430 /llvm/lib/Target | |
| parent | 2e84650768a57d81692b89b5bdfa297cb114f254 (diff) | |
| download | bcm5719-llvm-329d4a2b292ec19e2bb0eeb03889c7a6757e137d.tar.gz bcm5719-llvm-329d4a2b292ec19e2bb0eeb03889c7a6757e137d.zip | |
Verifier: Don't reject varargs callee cleanup functions
We've rejected these kinds of functions since r28405 in 2006 because
it's impossible to lower the return of a callee cleanup varargs
function. However there are lots of legal ways to leave such a function
without returning, such as aborting. Today we can leave a function with
a musttail call to another function with the correct prototype, and
everything works out.
I'm removing the verifier check declaring that a normal return from such
a function is UB.
Reviewed By: nlewycky
Differential Revision: http://reviews.llvm.org/D5059
llvm-svn: 216779
Diffstat (limited to 'llvm/lib/Target')
| -rw-r--r-- | llvm/lib/Target/X86/X86ISelLowering.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index 7c0bfeef947..0972a034d90 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -3605,23 +3605,18 @@ bool X86::isOffsetSuitableForCodeModel(int64_t Offset, CodeModel::Model M, /// own arguments. Callee pop is necessary to support tail calls. bool X86::isCalleePop(CallingConv::ID CallingConv, bool is64Bit, bool IsVarArg, bool TailCallOpt) { - if (IsVarArg) - return false; - switch (CallingConv) { default: return false; case CallingConv::X86_StdCall: - return !is64Bit; case CallingConv::X86_FastCall: - return !is64Bit; case CallingConv::X86_ThisCall: return !is64Bit; case CallingConv::Fast: - return TailCallOpt; case CallingConv::GHC: - return TailCallOpt; case CallingConv::HiPE: + if (IsVarArg) + return false; return TailCallOpt; } } |

