From 45df9c68b4d8eb2206b884c38e89f56d41452c83 Mon Sep 17 00:00:00 2001 From: Argyrios Kyrtzidis Date: Fri, 9 Sep 2011 06:44:14 +0000 Subject: [PATCH] Use ArrayRef in ExternalASTSource::SetExternalVisibleDeclsForName. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139357 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/AST/ExternalASTSource.h | 2 +- lib/AST/DeclBase.cpp | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/include/clang/AST/ExternalASTSource.h b/include/clang/AST/ExternalASTSource.h index 94b756773b..96d14b2954 100644 --- a/include/clang/AST/ExternalASTSource.h +++ b/include/clang/AST/ExternalASTSource.h @@ -216,7 +216,7 @@ protected: static DeclContextLookupResult SetExternalVisibleDeclsForName(const DeclContext *DC, DeclarationName Name, - SmallVectorImpl &Decls); + ArrayRef Decls); static DeclContextLookupResult SetNoExternalVisibleDeclsForName(const DeclContext *DC, diff --git a/lib/AST/DeclBase.cpp b/lib/AST/DeclBase.cpp index f846648844..68cf82edc4 100644 --- a/lib/AST/DeclBase.cpp +++ b/lib/AST/DeclBase.cpp @@ -904,7 +904,7 @@ ExternalASTSource::SetNoExternalVisibleDeclsForName(const DeclContext *DC, DeclContext::lookup_result ExternalASTSource::SetExternalVisibleDeclsForName(const DeclContext *DC, DeclarationName Name, - SmallVectorImpl &Decls) { + ArrayRef Decls) { ASTContext &Context = DC->getParentASTContext();; StoredDeclsMap *Map; @@ -912,11 +912,12 @@ ExternalASTSource::SetExternalVisibleDeclsForName(const DeclContext *DC, Map = DC->CreateStoredDeclsMap(Context); StoredDeclsList &List = (*Map)[Name]; - for (unsigned I = 0, N = Decls.size(); I != N; ++I) { + for (ArrayRef::iterator + I = Decls.begin(), E = Decls.end(); I != E; ++I) { if (List.isNull()) - List.setOnlyValue(Decls[I]); + List.setOnlyValue(*I); else - List.AddSubsequentDecl(Decls[I]); + List.AddSubsequentDecl(*I); } return List.getLookupResult(); -- 2.40.0