slightly simplify interface
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42858 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/AST/ASTContext.cpp b/AST/ASTContext.cpp
index 56138c3..f26105f 100644
--- a/AST/ASTContext.cpp
+++ b/AST/ASTContext.cpp
@@ -627,9 +627,8 @@
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);
diff --git a/include/clang/AST/Type.h b/include/clang/AST/Type.h
index 0af6b13..5018ca0 100644
--- a/include/clang/AST/Type.h
+++ b/include/clang/AST/Type.h
@@ -846,12 +846,10 @@
// 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: