diff options
Diffstat (limited to 'lib/AST')
-rw-r--r-- | lib/AST/CXXInheritance.cpp | 22 | ||||
-rw-r--r-- | lib/AST/DeclBase.cpp | 10 | ||||
-rw-r--r-- | lib/AST/DeclCXX.cpp | 16 | ||||
-rw-r--r-- | lib/AST/DeclObjC.cpp | 16 | ||||
-rw-r--r-- | lib/AST/ExprCXX.cpp | 6 |
5 files changed, 36 insertions, 34 deletions
diff --git a/lib/AST/CXXInheritance.cpp b/lib/AST/CXXInheritance.cpp index e0e3a69856..5083a010e1 100644 --- a/lib/AST/CXXInheritance.cpp +++ b/lib/AST/CXXInheritance.cpp @@ -28,7 +28,7 @@ void CXXBasePaths::ComputeDeclsFound() { llvm::SetVector<NamedDecl *, SmallVector<NamedDecl *, 8> > Decls; for (paths_iterator Path = begin(), PathEnd = end(); Path != PathEnd; ++Path) - Decls.insert(*Path->Decls.first); + Decls.insert(Path->Decls.front()); NumDeclsFound = Decls.size(); DeclsFound = new NamedDecl * [NumDeclsFound]; @@ -397,9 +397,9 @@ bool CXXRecordDecl::FindTagMember(const CXXBaseSpecifier *Specifier, DeclarationName N = DeclarationName::getFromOpaquePtr(Name); for (Path.Decls = BaseRecord->lookup(N); - Path.Decls.first != Path.Decls.second; - ++Path.Decls.first) { - if ((*Path.Decls.first)->isInIdentifierNamespace(IDNS_Tag)) + !Path.Decls.empty(); + Path.Decls = Path.Decls.slice(1)) { + if (Path.Decls.front()->isInIdentifierNamespace(IDNS_Tag)) return true; } @@ -415,9 +415,9 @@ bool CXXRecordDecl::FindOrdinaryMember(const CXXBaseSpecifier *Specifier, const unsigned IDNS = IDNS_Ordinary | IDNS_Tag | IDNS_Member; DeclarationName N = DeclarationName::getFromOpaquePtr(Name); for (Path.Decls = BaseRecord->lookup(N); - Path.Decls.first != Path.Decls.second; - ++Path.Decls.first) { - if ((*Path.Decls.first)->isInIdentifierNamespace(IDNS)) + !Path.Decls.empty(); + Path.Decls = Path.Decls.slice(1)) { + if (Path.Decls.front()->isInIdentifierNamespace(IDNS)) return true; } @@ -433,11 +433,11 @@ FindNestedNameSpecifierMember(const CXXBaseSpecifier *Specifier, DeclarationName N = DeclarationName::getFromOpaquePtr(Name); for (Path.Decls = BaseRecord->lookup(N); - Path.Decls.first != Path.Decls.second; - ++Path.Decls.first) { + !Path.Decls.empty(); + Path.Decls = Path.Decls.slice(1)) { // FIXME: Refactor the "is it a nested-name-specifier?" check - if (isa<TypedefNameDecl>(*Path.Decls.first) || - (*Path.Decls.first)->isInIdentifierNamespace(IDNS_Tag)) + if (isa<TypedefNameDecl>(Path.Decls.front()) || + Path.Decls.front()->isInIdentifierNamespace(IDNS_Tag)) return true; } diff --git a/lib/AST/DeclBase.cpp b/lib/AST/DeclBase.cpp index 883e3fd698..5dccaac020 100644 --- a/lib/AST/DeclBase.cpp +++ b/lib/AST/DeclBase.cpp @@ -1206,7 +1206,7 @@ void DeclContext::localUncachedLookup(DeclarationName Name, // the results. if (!hasExternalVisibleStorage() && !hasExternalLexicalStorage() && Name) { lookup_result LookupResults = lookup(Name); - Results.insert(Results.end(), LookupResults.first, LookupResults.second); + Results.insert(Results.end(), LookupResults.begin(), LookupResults.end()); return; } @@ -1216,8 +1216,8 @@ void DeclContext::localUncachedLookup(DeclarationName Name, StoredDeclsMap::iterator Pos = Map->find(Name); if (Pos != Map->end()) { Results.insert(Results.end(), - Pos->second.getLookupResult().first, - Pos->second.getLookupResult().second); + Pos->second.getLookupResult().begin(), + Pos->second.getLookupResult().end()); return; } } @@ -1369,8 +1369,8 @@ DeclContext::getUsingDirectives() const { // FIXME: Use something more efficient than normal lookup for using // directives. In C++, using directives are looked up more than anything else. lookup_const_result Result = lookup(UsingDirectiveDecl::getName()); - return udir_iterator_range(reinterpret_cast<udir_iterator>(Result.first), - reinterpret_cast<udir_iterator>(Result.second)); + return udir_iterator_range(reinterpret_cast<udir_iterator>(Result.begin()), + reinterpret_cast<udir_iterator>(Result.end())); } //===----------------------------------------------------------------------===// diff --git a/lib/AST/DeclCXX.cpp b/lib/AST/DeclCXX.cpp index 73d6ddd6a6..fcd38ac721 100644 --- a/lib/AST/DeclCXX.cpp +++ b/lib/AST/DeclCXX.cpp @@ -1159,12 +1159,11 @@ CXXDestructorDecl *CXXRecordDecl::getDestructor() const { = Context.DeclarationNames.getCXXDestructorName( Context.getCanonicalType(ClassType)); - DeclContext::lookup_const_iterator I, E; - llvm::tie(I, E) = lookup(Name); - if (I == E) + DeclContext::lookup_const_result R = lookup(Name); + if (R.empty()) return 0; - CXXDestructorDecl *Dtor = cast<CXXDestructorDecl>(*I); + CXXDestructorDecl *Dtor = cast<CXXDestructorDecl>(R.front()); return Dtor; } @@ -1278,7 +1277,7 @@ CXXMethodDecl::getCorrespondingMethodInClass(const CXXRecordDecl *RD, } lookup_const_result Candidates = RD->lookup(getDeclName()); - for (NamedDecl * const * I = Candidates.first; I != Candidates.second; ++I) { + for (NamedDecl * const * I = Candidates.begin(); I != Candidates.end(); ++I) { CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(*I); if (!MD) continue; @@ -1353,9 +1352,10 @@ bool CXXMethodDecl::isUsualDeallocationFunction() const { // This function is a usual deallocation function if there are no // single-parameter deallocation functions of the same kind. - for (DeclContext::lookup_const_result R = getDeclContext()->lookup(getDeclName()); - R.first != R.second; ++R.first) { - if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(*R.first)) + DeclContext::lookup_const_result R = getDeclContext()->lookup(getDeclName()); + for (DeclContext::lookup_const_result::iterator I = R.begin(), E = R.end(); + I != E; ++I) { + if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(*I)) if (FD->getNumParams() == 1) return false; } diff --git a/lib/AST/DeclObjC.cpp b/lib/AST/DeclObjC.cpp index 2b7b13b43f..12e5d8c304 100644 --- a/lib/AST/DeclObjC.cpp +++ b/lib/AST/DeclObjC.cpp @@ -54,8 +54,9 @@ void ObjCContainerDecl::anchor() { } /// ObjCIvarDecl * ObjCContainerDecl::getIvarDecl(IdentifierInfo *Id) const { - lookup_const_iterator Ivar, IvarEnd; - for (llvm::tie(Ivar, IvarEnd) = lookup(Id); Ivar != IvarEnd; ++Ivar) { + lookup_const_result R = lookup(Id); + for (lookup_const_iterator Ivar = R.begin(), IvarEnd = R.end(); + Ivar != IvarEnd; ++Ivar) { if (ObjCIvarDecl *ivar = dyn_cast<ObjCIvarDecl>(*Ivar)) return ivar; } @@ -73,8 +74,9 @@ ObjCContainerDecl::getMethod(Selector Sel, bool isInstance) const { // + (float) class_method; // @end // - lookup_const_iterator Meth, MethEnd; - for (llvm::tie(Meth, MethEnd) = lookup(Sel); Meth != MethEnd; ++Meth) { + lookup_const_result R = lookup(Sel); + for (lookup_const_iterator Meth = R.begin(), MethEnd = R.end(); + Meth != MethEnd; ++Meth) { ObjCMethodDecl *MD = dyn_cast<ObjCMethodDecl>(*Meth); if (MD && MD->isInstanceMethod() == isInstance) return MD; @@ -86,9 +88,9 @@ ObjCPropertyDecl * ObjCPropertyDecl::findPropertyDecl(const DeclContext *DC, IdentifierInfo *propertyID) { - DeclContext::lookup_const_iterator I, E; - llvm::tie(I, E) = DC->lookup(propertyID); - for ( ; I != E; ++I) + DeclContext::lookup_const_result R = DC->lookup(propertyID); + for (DeclContext::lookup_const_iterator I = R.begin(), E = R.end(); I != E; + ++I) if (ObjCPropertyDecl *PD = dyn_cast<ObjCPropertyDecl>(*I)) return PD; diff --git a/lib/AST/ExprCXX.cpp b/lib/AST/ExprCXX.cpp index 1dc7de1b4d..6c66c90cd4 100644 --- a/lib/AST/ExprCXX.cpp +++ b/lib/AST/ExprCXX.cpp @@ -964,9 +964,9 @@ CXXMethodDecl *LambdaExpr::getCallOperator() const { DeclarationName Name = Record->getASTContext().DeclarationNames.getCXXOperatorName(OO_Call); DeclContext::lookup_result Calls = Record->lookup(Name); - assert(Calls.first != Calls.second && "Missing lambda call operator!"); - CXXMethodDecl *Result = cast<CXXMethodDecl>(*Calls.first++); - assert(Calls.first == Calls.second && "More than lambda one call operator?"); + assert(!Calls.empty() && "Missing lambda call operator!"); + assert(Calls.size() == 1 && "More than one lambda call operator!"); + CXXMethodDecl *Result = cast<CXXMethodDecl>(Calls.front()); return Result; } |