From 00bb283ecdfb1d5c69261c7663d166cee3f11a9b Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 11 Oct 2007 03:36:41 +0000 Subject: [PATCH] slightly simplify interface git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42858 91177308-0d34-0410-b5e6-96231b3b80d8 --- AST/ASTContext.cpp | 5 ++--- include/clang/AST/Type.h | 10 ++++------ 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/AST/ASTContext.cpp b/AST/ASTContext.cpp index 56138c3aa1..f26105f55a 100644 --- a/AST/ASTContext.cpp +++ b/AST/ASTContext.cpp @@ -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); diff --git a/include/clang/AST/Type.h b/include/clang/AST/Type.h index 0af6b134f0..5018ca0c1d 100644 --- a/include/clang/AST/Type.h +++ b/include/clang/AST/Type.h @@ -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 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: -- 2.40.0