assert(MD->isInstance() &&
"Trying to emit a member call expr on a static method!");
- const CGFunctionInfo &FnInfo = CGM.getTypes().getFunctionInfo(MD);
-
- bool IsVariadic = MD->getType()->getAsFunctionProtoType()->isVariadic();
+ const FunctionProtoType *FPT = MD->getType()->getAsFunctionProtoType();
const llvm::Type *Ty =
- CGM.getTypes().GetFunctionType(FnInfo, IsVariadic);
-
+ CGM.getTypes().GetFunctionType(CGM.getTypes().getFunctionInfo(MD),
+ FPT->isVariadic());
llvm::Constant *Callee = CGM.GetAddrOfFunction(MD, Ty);
llvm::Value *BaseValue = 0;
Args.push_back(std::make_pair(EmitAnyExprToTemp(*I), I->getType()));
QualType ResultType = MD->getType()->getAsFunctionType()->getResultType();
- return EmitCall(FnInfo, Callee, Args, MD);
+ return EmitCall(CGM.getTypes().getFunctionInfo(ResultType, Args),
+ Callee, Args, MD);
}
// RUN: clang-cc -emit-llvm %s -o %t &&
struct C {
void f();
+ void g(int, ...);
};
// RUN: grep "define void @_ZN1C1fEv" %t | count 1 &&
void C::f() {
}
-// RUN: grep "call void @_ZN1C1fEv" %t | count 1
void f() {
C c;
+// RUN: grep "call void @_ZN1C1fEv" %t | count 1 &&
c.f();
-}
\ No newline at end of file
+
+// RUN: grep "call void (.struct.C\*, i32, ...)\* @_ZN1C1gEiz" %t | count 1
+ c.g(1, 2, 3);
+}