aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Index/FileIndexRecord.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2023-02-11 12:38:04 +0000
committerDimitry Andric <dim@FreeBSD.org>2023-02-11 12:38:11 +0000
commite3b557809604d036af6e00c60f012c2025b59a5e (patch)
tree8a11ba2269a3b669601e2fd41145b174008f4da8 /clang/lib/Index/FileIndexRecord.cpp
parent08e8dd7b9db7bb4a9de26d44c1cbfd24e869c014 (diff)
Diffstat (limited to 'clang/lib/Index/FileIndexRecord.cpp')
-rw-r--r--clang/lib/Index/FileIndexRecord.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/clang/lib/Index/FileIndexRecord.cpp b/clang/lib/Index/FileIndexRecord.cpp
index d4d1d2f70a9a..f3a5e6b63bbc 100644
--- a/clang/lib/Index/FileIndexRecord.cpp
+++ b/clang/lib/Index/FileIndexRecord.cpp
@@ -45,13 +45,11 @@ void FileIndexRecord::addMacroOccurence(SymbolRoleSet Roles, unsigned Offset,
}
void FileIndexRecord::removeHeaderGuardMacros() {
- auto It =
- std::remove_if(Decls.begin(), Decls.end(), [](const DeclOccurrence &D) {
- if (const auto *MI = D.DeclOrMacro.dyn_cast<const MacroInfo *>())
- return MI->isUsedForHeaderGuard();
- return false;
- });
- Decls.erase(It, Decls.end());
+ llvm::erase_if(Decls, [](const DeclOccurrence &D) {
+ if (const auto *MI = D.DeclOrMacro.dyn_cast<const MacroInfo *>())
+ return MI->isUsedForHeaderGuard();
+ return false;
+ });
}
void FileIndexRecord::print(llvm::raw_ostream &OS, SourceManager &SM) const {