summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-05-12 20:27:19 +0000
committerChris Lattner <sabre@nondot.org>2009-05-12 20:27:19 +0000
commitbea5b622be285f7b1f5af3d23047970a968677b1 (patch)
treee5354d5a0134ac6e413fa6afab9bbcb5d01bec92 /clang/lib/CodeGen
parente7834115ebd5f8a8b4b168d8318ae29dd94a7652 (diff)
downloadbcm5719-llvm-bea5b622be285f7b1f5af3d23047970a968677b1.tar.gz
bcm5719-llvm-bea5b622be285f7b1f5af3d23047970a968677b1.zip
static methods don't get this pointers.
llvm-svn: 71586
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CGCall.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp
index 1df9b0be635..072cc58e08f 100644
--- a/clang/lib/CodeGen/CGCall.cpp
+++ b/clang/lib/CodeGen/CGCall.cpp
@@ -55,8 +55,9 @@ CGFunctionInfo &CodeGenTypes::getFunctionInfo(const FunctionProtoType *FTP) {
const CGFunctionInfo &CodeGenTypes::getFunctionInfo(const CXXMethodDecl *MD) {
llvm::SmallVector<QualType, 16> ArgTys;
- // Add the 'this' pointer.
- ArgTys.push_back(MD->getThisType(Context));
+ // Add the 'this' pointer unless this is a static method.
+ if (MD->isInstance())
+ ArgTys.push_back(MD->getThisType(Context));
const FunctionProtoType *FTP = MD->getType()->getAsFunctionProtoType();
for (unsigned i = 0, e = FTP->getNumArgs(); i != e; ++i)
@@ -65,10 +66,9 @@ const CGFunctionInfo &CodeGenTypes::getFunctionInfo(const CXXMethodDecl *MD) {
}
const CGFunctionInfo &CodeGenTypes::getFunctionInfo(const FunctionDecl *FD) {
- if (const CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(FD)) {
+ if (const CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(FD))
if (MD->isInstance())
return getFunctionInfo(MD);
- }
const FunctionType *FTy = FD->getType()->getAsFunctionType();
if (const FunctionProtoType *FTP = dyn_cast<FunctionProtoType>(FTy))
OpenPOWER on IntegriCloud