зеркало из https://github.com/microsoft/clang.git
static methods don't get this pointers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71586 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
005eedce54
Коммит
3eb67ca786
|
@ -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))
|
||||
|
|
Загрузка…
Ссылка в новой задаче