r189170 - Replace compLocDecl with less_first.
Benjamin Kramer
benny.kra at googlemail.com
Sat Aug 24 06:12:34 PDT 2013
Author: d0k
Date: Sat Aug 24 08:12:34 2013
New Revision: 189170
URL: http://llvm.org/viewvc/llvm-project?rev=189170&view=rev
Log:
Replace compLocDecl with less_first.
Modified:
cfe/trunk/lib/Frontend/ASTUnit.cpp
cfe/trunk/lib/Serialization/ASTWriter.cpp
Modified: cfe/trunk/lib/Frontend/ASTUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/ASTUnit.cpp?rev=189170&r1=189169&r2=189170&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/ASTUnit.cpp (original)
+++ cfe/trunk/lib/Frontend/ASTUnit.cpp Sat Aug 24 08:12:34 2013
@@ -2644,11 +2644,6 @@ void ASTUnit::TranslateStoredDiagnostics
Result.swap(Out);
}
-static inline bool compLocDecl(std::pair<unsigned, Decl *> L,
- std::pair<unsigned, Decl *> R) {
- return L.first < R.first;
-}
-
void ASTUnit::addFileLevelDecl(Decl *D) {
assert(D);
@@ -2684,8 +2679,8 @@ void ASTUnit::addFileLevelDecl(Decl *D)
return;
}
- LocDeclsTy::iterator
- I = std::upper_bound(Decls->begin(), Decls->end(), LocDecl, compLocDecl);
+ LocDeclsTy::iterator I =
+ std::upper_bound(Decls->begin(), Decls->end(), LocDecl, less_first());
Decls->insert(I, LocDecl);
}
@@ -2709,9 +2704,9 @@ void ASTUnit::findFileRegionDecls(FileID
if (LocDecls.empty())
return;
- LocDeclsTy::iterator
- BeginIt = std::lower_bound(LocDecls.begin(), LocDecls.end(),
- std::make_pair(Offset, (Decl*)0), compLocDecl);
+ LocDeclsTy::iterator BeginIt =
+ std::lower_bound(LocDecls.begin(), LocDecls.end(),
+ std::make_pair(Offset, (Decl *)0), less_first());
if (BeginIt != LocDecls.begin())
--BeginIt;
@@ -2722,10 +2717,9 @@ void ASTUnit::findFileRegionDecls(FileID
BeginIt->second->isTopLevelDeclInObjCContainer())
--BeginIt;
- LocDeclsTy::iterator
- EndIt = std::upper_bound(LocDecls.begin(), LocDecls.end(),
- std::make_pair(Offset+Length, (Decl*)0),
- compLocDecl);
+ LocDeclsTy::iterator EndIt = std::upper_bound(
+ LocDecls.begin(), LocDecls.end(),
+ std::make_pair(Offset + Length, (Decl *)0), less_first());
if (EndIt != LocDecls.end())
++EndIt;
Modified: cfe/trunk/lib/Serialization/ASTWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTWriter.cpp?rev=189170&r1=189169&r2=189170&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/ASTWriter.cpp (original)
+++ cfe/trunk/lib/Serialization/ASTWriter.cpp Sat Aug 24 08:12:34 2013
@@ -4623,11 +4623,6 @@ DeclID ASTWriter::getDeclID(const Decl *
return DeclIDs[D];
}
-static inline bool compLocDecl(std::pair<unsigned, serialization::DeclID> L,
- std::pair<unsigned, serialization::DeclID> R) {
- return L.first < R.first;
-}
-
void ASTWriter::associateDeclWithFile(const Decl *D, DeclID ID) {
assert(ID);
assert(D);
@@ -4667,7 +4662,7 @@ void ASTWriter::associateDeclWithFile(co
}
LocDeclIDsTy::iterator
- I = std::upper_bound(Decls.begin(), Decls.end(), LocDecl, compLocDecl);
+ I = std::upper_bound(Decls.begin(), Decls.end(), LocDecl, less_first());
Decls.insert(I, LocDecl);
}
More information about the cfe-commits
mailing list