diff options
author | Anders Carlsson <andersca@mac.com> | 2009-09-29 03:54:11 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2009-09-29 03:54:11 +0000 |
commit | 2472bf0a1735fa9c60a01946d5ed53b64c9c2422 (patch) | |
tree | 7f4eba424a146c8240aa66ddd40a06554703d775 /lib/CodeGen/CGCXX.cpp | |
parent | 7b69956387785006244e7868f8dab09b371dbb6d (diff) |
Handle CXXMemberCallExprs that point to a static method. Fixes PR5093.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83045 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGCXX.cpp')
-rw-r--r-- | lib/CodeGen/CGCXX.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/CodeGen/CGCXX.cpp b/lib/CodeGen/CGCXX.cpp index e37b4a8548..bf9af9c64d 100644 --- a/lib/CodeGen/CGCXX.cpp +++ b/lib/CodeGen/CGCXX.cpp @@ -202,6 +202,14 @@ RValue CodeGenFunction::EmitCXXMemberCallExpr(const CXXMemberCallExpr *CE) { const MemberExpr *ME = cast<MemberExpr>(CE->getCallee()); const CXXMethodDecl *MD = cast<CXXMethodDecl>(ME->getMemberDecl()); + if (MD->isStatic()) { + // The method is static, emit it as we would a regular call. + llvm::Value *Callee = CGM.GetAddrOfFunction(MD); + return EmitCall(Callee, getContext().getPointerType(MD->getType()), + CE->arg_begin(), CE->arg_end(), 0); + + } + const FunctionProtoType *FPT = MD->getType()->getAs<FunctionProtoType>(); const llvm::Type *Ty = |