]> granicus.if.org Git - clang/commitdiff
Initialize CGFunctionInfo isVariadic bit correctly.
authorDaniel Dunbar <daniel@zuster.org>
Sat, 31 Jan 2009 02:54:56 +0000 (02:54 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Sat, 31 Jan 2009 02:54:56 +0000 (02:54 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63471 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGCall.cpp

index b6c5d8d273ed1cc7648ab4f8899f0db437f42bd5..08d5da30fa35fac2a2a38f7e03911858dbf3cacd 100644 (file)
@@ -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<llvm::FunctionType>(Callee->getType())->isVarArg();
-  CGFunctionInfo CallInfo(RetTy, CallArgs, isVariadic);
+  const llvm::Type *FnType = 
+    cast<llvm::PointerType>(Callee->getType())->getElementType();
+  CGFunctionInfo CallInfo(RetTy, CallArgs, 
+                          cast<llvm::FunctionType>(FnType)->isVarArg());
 
   // FIXME: Provide TargetDecl so nounwind, noreturn, etc, etc get set.
   CodeGen::AttributeListType AttributeList;