[cfe-commits] r68451 - /cfe/trunk/lib/CodeGen/CGCXX.cpp
Anders Carlsson
andersca at mac.com
Mon Apr 6 10:45:20 PDT 2009
Author: andersca
Date: Mon Apr 6 12:45:20 2009
New Revision: 68451
URL: http://llvm.org/viewvc/llvm-project?rev=68451&view=rev
Log:
Simplify C++ member function calls.
Modified:
cfe/trunk/lib/CodeGen/CGCXX.cpp
Modified: cfe/trunk/lib/CodeGen/CGCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCXX.cpp?rev=68451&r1=68450&r2=68451&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGCXX.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGCXX.cpp Mon Apr 6 12:45:20 2009
@@ -142,10 +142,11 @@
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 llvm::Type *Ty =
- CGM.getTypes().GetFunctionType(CGM.getTypes().getFunctionInfo(MD),
- IsVariadic);
+ CGM.getTypes().GetFunctionType(FnInfo, IsVariadic);
llvm::Constant *Callee = CGM.GetAddrOfFunction(MD, Ty);
@@ -172,7 +173,5 @@
Args.push_back(std::make_pair(EmitAnyExprToTemp(*I), I->getType()));
QualType ResultType = MD->getType()->getAsFunctionType()->getResultType();
- return EmitCall(CGM.getTypes().getFunctionInfo(ResultType, Args),
- Callee, Args, MD);
- return EmitUnsupportedRValue(CE, "C++ member call expr");
+ return EmitCall(FnInfo, Callee, Args, MD);
}
More information about the cfe-commits
mailing list