Added class context to method declarations. Provide "interface *" type
to 'self' method of instance methods.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43957 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Sema/SemaType.cpp b/Sema/SemaType.cpp
index 6398c6f..71ec3f3 100644
--- a/Sema/SemaType.cpp
+++ b/Sema/SemaType.cpp
@@ -333,9 +333,11 @@
llvm::SmallVector<QualType, 16> ArgTys;
// Add the first two invisible argument types for self and _cmd.
- if (MDecl->isInstance())
- // FIXME: interface-name *
- ArgTys.push_back(Context.getObjcIdType());
+ if (MDecl->isInstance()) {
+ QualType selfTy = Context.getObjcInterfaceType(MDecl->getClassInterface());
+ selfTy = Context.getPointerType(selfTy);
+ ArgTys.push_back(selfTy);
+ }
else
ArgTys.push_back(Context.getObjcIdType());
ArgTys.push_back(Context.getObjcSelType());