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/Parse/ParseObjc.cpp b/Parse/ParseObjc.cpp
index 1f38c23..a3fb0e8 100644
--- a/Parse/ParseObjc.cpp
+++ b/Parse/ParseObjc.cpp
@@ -416,7 +416,7 @@
   tok::TokenKind methodType = Tok.getKind();  
   SourceLocation mLoc = ConsumeToken();
   
-  DeclTy *MDecl = ParseObjCMethodDecl(mLoc, methodType, MethodImplKind);
+  DeclTy *MDecl = ParseObjCMethodDecl(mLoc, methodType, IDecl, MethodImplKind);
   // Since this rule is used for both method declarations and definitions,
   // the caller is (optionally) responsible for consuming the ';'.
   return MDecl;
@@ -550,7 +550,8 @@
 ///     __attribute__((unused))
 ///
 Parser::DeclTy *Parser::ParseObjCMethodDecl(SourceLocation mLoc,
-                                            tok::TokenKind mType, 
+                                            tok::TokenKind mType,
+                                            DeclTy *IDecl,
 					    tok::ObjCKeywordKind MethodImplKind)
 {
   // Parse the return type.
@@ -574,7 +575,7 @@
     
     Selector Sel = PP.getSelectorTable().getNullarySelector(SelIdent);
     return Actions.ActOnMethodDeclaration(mLoc, Tok.getLocation(),
-                                          mType, DSRet, ReturnType, Sel,
+                                          mType, IDecl, DSRet, ReturnType, Sel,
                                           0, 0, 0, MethodAttrs, MethodImplKind);
   }
 
@@ -645,7 +646,7 @@
   Selector Sel = PP.getSelectorTable().getSelector(KeyIdents.size(),
                                                    &KeyIdents[0]);
   return Actions.ActOnMethodDeclaration(mLoc, Tok.getLocation(),
-                                        mType, DSRet, ReturnType, Sel, 
+                                        mType, IDecl, DSRet, ReturnType, Sel, 
                                         &ArgTypeQuals[0], &KeyTypes[0], 
                                         &ArgNames[0],
                                         MethodAttrs, MethodImplKind);