From c0ddef23136368ce1bd882f7edd43591c8f30aa6 Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Tue, 1 Mar 2011 17:28:13 +0000 Subject: objc IRGen for Next runtime message API. The prototype for objc_msgSend() is technically variadic - `id objc_msgSend(id, SEL, ...)`. But all method calls should use a prototype that matches the method, not the prototype for objc_msgSend itself(). // rdar://9048030 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126754 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGCall.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/CodeGen/CGCall.cpp') diff --git a/lib/CodeGen/CGCall.cpp b/lib/CodeGen/CGCall.cpp index ae84b6196d..1d9a9a6a8c 100644 --- a/lib/CodeGen/CGCall.cpp +++ b/lib/CodeGen/CGCall.cpp @@ -1275,7 +1275,8 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo, if (CE->getOpcode() == llvm::Instruction::BitCast && ActualFT->getReturnType() == CurFT->getReturnType() && ActualFT->getNumParams() == CurFT->getNumParams() && - ActualFT->getNumParams() == Args.size()) { + ActualFT->getNumParams() == Args.size() && + (CurFT->isVarArg() || !ActualFT->isVarArg())) { bool ArgsMatch = true; for (unsigned i = 0, e = ActualFT->getNumParams(); i != e; ++i) if (ActualFT->getParamType(i) != CurFT->getParamType(i)) { -- cgit v1.2.3