summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGCXX.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-09-29 03:54:11 +0000
committerAnders Carlsson <andersca@mac.com>2009-09-29 03:54:11 +0000
commit8f4fd60c47a5790f058d8a6083cbabac7d920f23 (patch)
tree09817b76abc5cc9334913877b615bf865d0ac9ce /clang/lib/CodeGen/CGCXX.cpp
parent33c6a7a12edf27145c462786d8bf2b0d03b1b02b (diff)
downloadbcm5719-llvm-8f4fd60c47a5790f058d8a6083cbabac7d920f23.tar.gz
bcm5719-llvm-8f4fd60c47a5790f058d8a6083cbabac7d920f23.zip
Handle CXXMemberCallExprs that point to a static method. Fixes PR5093.
llvm-svn: 83045
Diffstat (limited to 'clang/lib/CodeGen/CGCXX.cpp')
-rw-r--r--clang/lib/CodeGen/CGCXX.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGCXX.cpp b/clang/lib/CodeGen/CGCXX.cpp
index e37b4a85482..bf9af9c64da 100644
--- a/clang/lib/CodeGen/CGCXX.cpp
+++ b/clang/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 =
OpenPOWER on IntegriCloud