]> granicus.if.org Git - clang/commitdiff
slightly simplify interface
authorChris Lattner <sabre@nondot.org>
Thu, 11 Oct 2007 03:36:41 +0000 (03:36 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 11 Oct 2007 03:36:41 +0000 (03:36 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42858 91177308-0d34-0410-b5e6-96231b3b80d8

AST/ASTContext.cpp
include/clang/AST/Type.h

index 56138c3aa169dd889c9b9fe972aa1b3f7cae19f9..f26105f55a98c006c8142d969c8db257ef6eb0f0 100644 (file)
@@ -627,9 +627,8 @@ QualType ASTContext::getObjcQualifiedInterfaceType(ObjcInterfaceDecl *Decl,
     return QualType(QT, 0);
   
   // No Match;
-  ObjcQualifiedInterfaceType *QType = new ObjcQualifiedInterfaceType(IType);
-  for (unsigned i = 0; i != NumProtocols; i++)
-    QType->setProtocols(Protocols[i]);
+  ObjcQualifiedInterfaceType *QType =
+    new ObjcQualifiedInterfaceType(IType, Protocols, NumProtocols);
   Types.push_back(QType);
   ObjcQualifiedInterfaceTypes.InsertNode(QType, InsertPos);
   return QualType(QType, 0);
index 0af6b134f09e24f8abc4dacf6589866b31028438..5018ca0c1df8987d0790d2ae322b102c9d323734 100644 (file)
@@ -846,12 +846,10 @@ class ObjcQualifiedInterfaceType : public Type, public llvm::FoldingSetNode {
   // List is sorted on protocol name. No protocol is enterred more than once.
   llvm::SmallVector<ObjcProtocolDecl*, 8> Protocols;
 
-  ObjcQualifiedInterfaceType(ObjcInterfaceType *T) : 
-    Type(ObjcQualifiedInterface, QualType()), InterfaceType(T) { }
-  
-  void setProtocols(ObjcProtocolDecl *pType) {
-    Protocols.push_back(pType);
-  }
+  ObjcQualifiedInterfaceType(ObjcInterfaceType *T,
+                             ObjcProtocolDecl **Protos,  unsigned NumP) : 
+    Type(ObjcQualifiedInterface, QualType()), InterfaceType(T),
+    Protocols(Protos, Protos+NumP) { }
   friend class ASTContext;  // ASTContext creates these.
 public: