Uses more description name for method implementation kind argument.
Moves such argument as the last argument and uses defaul value.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42073 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Sema/SemaDecl.cpp b/Sema/SemaDecl.cpp
index 53efacf..b9ac2b7 100644
--- a/Sema/SemaDecl.cpp
+++ b/Sema/SemaDecl.cpp
@@ -1264,11 +1264,11 @@
   return;
 }
 
-Sema::DeclTy *Sema::ObjcBuildMethodDeclaration(tok::ObjCKeywordKind& pi,
-		      SourceLocation MethodLoc, 
+Sema::DeclTy *Sema::ObjcBuildMethodDeclaration(SourceLocation MethodLoc, 
                       tok::TokenKind MethodType, TypeTy *ReturnType,
                       ObjcKeywordDecl *Keywords, unsigned NumKeywords,
-                      AttributeList *AttrList) {
+                      AttributeList *AttrList,
+		      tok::ObjCKeywordKind MethodDeclKind) {
   assert(NumKeywords && "Selector must be specified");
 
   // Derive the selector name from the keyword declarations.
@@ -1306,17 +1306,17 @@
 				      SelName, resultDeclType,
 		      		      0, -1, AttrList, MethodType == tok::minus);
   ObjcMethod->setMethodParams(&Params[0], NumKeywords);
-  if (pi == tok::objc_optional)
+  if (MethodDeclKind == tok::objc_optional)
       ObjcMethod->setDeclImplementation(ObjcMethodDecl::Optional);
   else
        ObjcMethod->setDeclImplementation(ObjcMethodDecl::Required);
   return ObjcMethod;
 }
 
-Sema::DeclTy *Sema::ObjcBuildMethodDeclaration(tok::ObjCKeywordKind& pi,
-		      SourceLocation MethodLoc,  
+Sema::DeclTy *Sema::ObjcBuildMethodDeclaration(SourceLocation MethodLoc,  
                       tok::TokenKind MethodType, TypeTy *ReturnType,
-                      IdentifierInfo *SelectorName, AttributeList *AttrList) {
+                      IdentifierInfo *SelectorName, AttributeList *AttrList,
+		      tok::ObjCKeywordKind MethodDeclKind) {
   const char *methodName = SelectorName->getName();
   SelectorInfo &SelName = Context.getSelectorInfo(methodName, 
                                                   methodName+strlen(methodName));
@@ -1324,7 +1324,7 @@
   ObjcMethodDecl* ObjcMethod = new ObjcMethodDecl(MethodLoc, 
 			             SelName, resultDeclType, 0, -1,
                                      AttrList, MethodType == tok::minus);
-  if (pi == tok::objc_optional)
+  if (MethodDeclKind == tok::objc_optional)
       ObjcMethod->setDeclImplementation(ObjcMethodDecl::Optional);
   else
        ObjcMethod->setDeclImplementation(ObjcMethodDecl::Required);