introduce a new ObjCList templated class and start moving 
various objc lists over to it.  First up, the protocol list 
on ObjCInterfaceDecl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53856 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp
index ad40cbe..5188740 100644
--- a/lib/Sema/SemaDeclObjC.cpp
+++ b/lib/Sema/SemaDeclObjC.cpp
@@ -653,9 +653,11 @@
   
   // Check the protocol list for unimplemented methods in the @implementation
   // class.
-  ObjCProtocolDecl** protocols = IDecl->getReferencedProtocols();
-  for (unsigned i = 0; i < IDecl->getNumIntfRefProtocols(); i++)
-    CheckProtocolMethodDefs(IMPDecl->getLocation(), protocols[i], 
+  const ObjCList<ObjCProtocolDecl> &Protocols =
+    IDecl->getReferencedProtocols();
+  for (ObjCList<ObjCProtocolDecl>::iterator I = Protocols.begin(),
+       E = Protocols.end(); I != E; ++I)
+    CheckProtocolMethodDefs(IMPDecl->getLocation(), *I, 
                             IncompleteImpl, InsMap, ClsMap);
 }