From 6f6b0367ba358e4bc921a6b7b7438d829bcb778a Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Sat, 31 Jan 2009 02:54:56 +0000 Subject: [PATCH] Initialize CGFunctionInfo isVariadic bit correctly. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63471 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGCall.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/CodeGen/CGCall.cpp b/lib/CodeGen/CGCall.cpp index b6c5d8d273..08d5da30fa 100644 --- a/lib/CodeGen/CGCall.cpp +++ b/lib/CodeGen/CGCall.cpp @@ -1284,8 +1284,10 @@ RValue CodeGenFunction::EmitCall(llvm::Value *Callee, } llvm::CallInst *CI = Builder.CreateCall(Callee,&Args[0],&Args[0]+Args.size()); - bool isVariadic = false; // cast(Callee->getType())->isVarArg(); - CGFunctionInfo CallInfo(RetTy, CallArgs, isVariadic); + const llvm::Type *FnType = + cast(Callee->getType())->getElementType(); + CGFunctionInfo CallInfo(RetTy, CallArgs, + cast(FnType)->isVarArg()); // FIXME: Provide TargetDecl so nounwind, noreturn, etc, etc get set. CodeGen::AttributeListType AttributeList; -- 2.50.1