Pull protocol resolution of out ActOnStartClassInterface, this is also the 
last client of the old ParseObjCProtocolReferences, so it also removes it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54094 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Parse/MinimalAction.cpp b/lib/Parse/MinimalAction.cpp
index 91f3c6e..aa886ab 100644
--- a/lib/Parse/MinimalAction.cpp
+++ b/lib/Parse/MinimalAction.cpp
@@ -89,11 +89,14 @@
 
 Action::DeclTy *
 MinimalAction::ActOnStartClassInterface(SourceLocation AtInterfaceLoc,
-                    IdentifierInfo *ClassName, SourceLocation ClassLoc,
-                    IdentifierInfo *SuperName, SourceLocation SuperLoc,
-                    const IdentifierLocPair *ProtocolNames,
-                    unsigned NumProtocols,
-                    SourceLocation EndProtoLoc, AttributeList *AttrList) {
+                                        IdentifierInfo *ClassName,
+                                        SourceLocation ClassLoc,
+                                        IdentifierInfo *SuperName,
+                                        SourceLocation SuperLoc,
+                                        DeclTy * const *ProtoRefs,
+                                        unsigned NumProtocols,
+                                        SourceLocation EndProtoLoc,
+                                        AttributeList *AttrList) {
   TypeNameInfo *TI =
     new TypeNameInfo(1, ClassName->getFETokenInfo<TypeNameInfo>());
 
diff --git a/lib/Parse/ParseObjc.cpp b/lib/Parse/ParseObjc.cpp
index cabb5bf..980105a 100644
--- a/lib/Parse/ParseObjc.cpp
+++ b/lib/Parse/ParseObjc.cpp
@@ -186,16 +186,17 @@
     superClassLoc = ConsumeToken();
   }
   // Next, we need to check for any protocol references.
-  llvm::SmallVector<IdentifierLocPair, 8> ProtocolRefs;
-  SourceLocation endProtoLoc;
-  if (Tok.is(tok::less)) {
-    if (ParseObjCProtocolReferences(ProtocolRefs, endProtoLoc))
-      return 0;
-  }
-  DeclTy *ClsType = Actions.ActOnStartClassInterface(
-                      atLoc, nameId, nameLoc, 
-                      superClassId, superClassLoc, &ProtocolRefs[0], 
-                      ProtocolRefs.size(), endProtoLoc, attrList);
+  llvm::SmallVector<Action::DeclTy*, 8> ProtocolRefs;
+  SourceLocation EndProtoLoc;
+  if (Tok.is(tok::less) &&
+      ParseObjCProtocolReferences(ProtocolRefs, true, EndProtoLoc))
+    return 0;
+  
+  DeclTy *ClsType = 
+    Actions.ActOnStartClassInterface(atLoc, nameId, nameLoc, 
+                                     superClassId, superClassLoc,
+                                     &ProtocolRefs[0], ProtocolRefs.size(),
+                                     EndProtoLoc, attrList);
             
   if (Tok.is(tok::l_brace))
     ParseObjCClassInstanceVariables(ClsType, atLoc);
@@ -717,40 +718,6 @@
 ///     '<' identifier-list '>'
 ///
 bool Parser::
-ParseObjCProtocolReferences(llvm::SmallVectorImpl<IdentifierLocPair> &Protocols,
-                            SourceLocation &endLoc) {
-  assert(Tok.is(tok::less) && "expected <");
-  
-  ConsumeToken(); // the "<"
-  
-  while (1) {
-    if (Tok.isNot(tok::identifier)) {
-      Diag(Tok, diag::err_expected_ident);
-      SkipUntil(tok::greater);
-      return true;
-    }
-    Protocols.push_back(std::make_pair(Tok.getIdentifierInfo(),
-                                          Tok.getLocation()));
-    ConsumeToken();
-    
-    if (Tok.isNot(tok::comma))
-      break;
-    ConsumeToken();
-  }
-  
-  // Consume the '>'.
-  if (Tok.is(tok::greater)) {
-    endLoc = ConsumeAnyToken();
-    return false;
-  }
-  Diag(Tok, diag::err_expected_greater);
-  return true;
-}
-
-///   objc-protocol-refs:
-///     '<' identifier-list '>'
-///
-bool Parser::
 ParseObjCProtocolReferences(llvm::SmallVectorImpl<Action::DeclTy*> &Protocols,
                             bool WarnOnDeclarations, SourceLocation &EndLoc) {
   assert(Tok.is(tok::less) && "expected <");