diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-02-21 02:45:19 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-02-21 02:45:19 +0000 |
commit | cf4bdde33a0450f212e7577b71a7bcfe5213cb15 (patch) | |
tree | 0f26b261f986553682e4a0eb67867313b41c15f5 /clang/lib/AST | |
parent | 8d981962c043ed5111f8e941a1501e100e54f8f7 (diff) | |
download | bcm5719-llvm-cf4bdde33a0450f212e7577b71a7bcfe5213cb15.tar.gz bcm5719-llvm-cf4bdde33a0450f212e7577b71a7bcfe5213cb15.zip |
Cleanup: remove artificial division between lookup results and const lookup
results. No-one was ever modifying a lookup result, and it would not be
reasonable to do so.
llvm-svn: 230123
Diffstat (limited to 'clang/lib/AST')
-rw-r--r-- | clang/lib/AST/Decl.cpp | 4 | ||||
-rw-r--r-- | clang/lib/AST/DeclBase.cpp | 2 | ||||
-rw-r--r-- | clang/lib/AST/DeclCXX.cpp | 10 | ||||
-rw-r--r-- | clang/lib/AST/DeclObjC.cpp | 16 |
4 files changed, 16 insertions, 16 deletions
diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp index aadde0cb3a4..e7e9941e3da 100644 --- a/clang/lib/AST/Decl.cpp +++ b/clang/lib/AST/Decl.cpp @@ -2532,8 +2532,8 @@ FunctionDecl::getCorrespondingUnsizedGlobalDeallocationFunction() const { // This is a sized deallocation function. Find the corresponding unsized // deallocation function. - lookup_const_result R = getDeclContext()->lookup(getDeclName()); - for (lookup_const_result::iterator RI = R.begin(), RE = R.end(); RI != RE; + lookup_result R = getDeclContext()->lookup(getDeclName()); + for (lookup_result::iterator RI = R.begin(), RE = R.end(); RI != RE; ++RI) if (FunctionDecl *FD = dyn_cast<FunctionDecl>(*RI)) if (FD->getNumParams() == 1 && !FD->isVariadic()) diff --git a/clang/lib/AST/DeclBase.cpp b/clang/lib/AST/DeclBase.cpp index 30cca6f6b1b..17f542dc9a2 100644 --- a/clang/lib/AST/DeclBase.cpp +++ b/clang/lib/AST/DeclBase.cpp @@ -1585,7 +1585,7 @@ UsingDirectiveDecl *DeclContext::udir_iterator::operator*() const { DeclContext::udir_range DeclContext::using_directives() 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()); + lookup_result Result = lookup(UsingDirectiveDecl::getName()); return udir_range(Result.begin(), Result.end()); } diff --git a/clang/lib/AST/DeclCXX.cpp b/clang/lib/AST/DeclCXX.cpp index 536a1453aaa..87a063438bc 100644 --- a/clang/lib/AST/DeclCXX.cpp +++ b/clang/lib/AST/DeclCXX.cpp @@ -991,7 +991,7 @@ CXXMethodDecl* CXXRecordDecl::getLambdaCallOperator() const { if (!isLambda()) return nullptr; DeclarationName Name = getASTContext().DeclarationNames.getCXXOperatorName(OO_Call); - DeclContext::lookup_const_result Calls = lookup(Name); + DeclContext::lookup_result Calls = lookup(Name); assert(!Calls.empty() && "Missing lambda call operator!"); assert(Calls.size() == 1 && "More than one lambda call operator!"); @@ -1008,7 +1008,7 @@ CXXMethodDecl* CXXRecordDecl::getLambdaStaticInvoker() const { if (!isLambda()) return nullptr; DeclarationName Name = &getASTContext().Idents.get(getLambdaStaticInvokerName()); - DeclContext::lookup_const_result Invoker = lookup(Name); + DeclContext::lookup_result Invoker = lookup(Name); if (Invoker.empty()) return nullptr; assert(Invoker.size() == 1 && "More than one static invoker operator!"); NamedDecl *InvokerFun = Invoker.front(); @@ -1307,7 +1307,7 @@ CXXDestructorDecl *CXXRecordDecl::getDestructor() const { = Context.DeclarationNames.getCXXDestructorName( Context.getCanonicalType(ClassType)); - DeclContext::lookup_const_result R = lookup(Name); + DeclContext::lookup_result R = lookup(Name); if (R.empty()) return nullptr; @@ -1490,8 +1490,8 @@ bool CXXMethodDecl::isUsualDeallocationFunction() const { // This function is a usual deallocation function if there are no // single-parameter deallocation functions of the same kind. - DeclContext::lookup_const_result R = getDeclContext()->lookup(getDeclName()); - for (DeclContext::lookup_const_result::iterator I = R.begin(), E = R.end(); + DeclContext::lookup_result R = getDeclContext()->lookup(getDeclName()); + for (DeclContext::lookup_result::iterator I = R.begin(), E = R.end(); I != E; ++I) { if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(*I)) if (FD->getNumParams() == 1) diff --git a/clang/lib/AST/DeclObjC.cpp b/clang/lib/AST/DeclObjC.cpp index d97c7434eef..6e7478474d6 100644 --- a/clang/lib/AST/DeclObjC.cpp +++ b/clang/lib/AST/DeclObjC.cpp @@ -54,8 +54,8 @@ void ObjCContainerDecl::anchor() { } /// ObjCIvarDecl * ObjCContainerDecl::getIvarDecl(IdentifierInfo *Id) const { - lookup_const_result R = lookup(Id); - for (lookup_const_iterator Ivar = R.begin(), IvarEnd = R.end(); + lookup_result R = lookup(Id); + for (lookup_iterator Ivar = R.begin(), IvarEnd = R.end(); Ivar != IvarEnd; ++Ivar) { if (ObjCIvarDecl *ivar = dyn_cast<ObjCIvarDecl>(*Ivar)) return ivar; @@ -83,8 +83,8 @@ ObjCContainerDecl::getMethod(Selector Sel, bool isInstance, // + (float) class_method; // @end // - lookup_const_result R = lookup(Sel); - for (lookup_const_iterator Meth = R.begin(), MethEnd = R.end(); + lookup_result R = lookup(Sel); + for (lookup_iterator Meth = R.begin(), MethEnd = R.end(); Meth != MethEnd; ++Meth) { ObjCMethodDecl *MD = dyn_cast<ObjCMethodDecl>(*Meth); if (MD && MD->isInstanceMethod() == isInstance) @@ -101,8 +101,8 @@ ObjCContainerDecl::getMethod(Selector Sel, bool isInstance, bool ObjCContainerDecl::HasUserDeclaredSetterMethod( const ObjCPropertyDecl *Property) const { Selector Sel = Property->getSetterName(); - lookup_const_result R = lookup(Sel); - for (lookup_const_iterator Meth = R.begin(), MethEnd = R.end(); + lookup_result R = lookup(Sel); + for (lookup_iterator Meth = R.begin(), MethEnd = R.end(); Meth != MethEnd; ++Meth) { ObjCMethodDecl *MD = dyn_cast<ObjCMethodDecl>(*Meth); if (MD && MD->isInstanceMethod() && !MD->isImplicit()) @@ -161,8 +161,8 @@ ObjCPropertyDecl::findPropertyDecl(const DeclContext *DC, return nullptr; } - DeclContext::lookup_const_result R = DC->lookup(propertyID); - for (DeclContext::lookup_const_iterator I = R.begin(), E = R.end(); I != E; + DeclContext::lookup_result R = DC->lookup(propertyID); + for (DeclContext::lookup_iterator I = R.begin(), E = R.end(); I != E; ++I) if (ObjCPropertyDecl *PD = dyn_cast<ObjCPropertyDecl>(*I)) return PD; |