aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGCall.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen/CGCall.cpp')
-rw-r--r--lib/CodeGen/CGCall.cpp6
1 files 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<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;