aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2025-05-16 07:32:44 -0700
committerGitHub <noreply@github.com>2025-05-16 07:32:44 -0700
commit4567c11d284fe404df80fb3293dac3e2aa85b79e (patch)
tree99e67aeb6ed13a0bfdef4fc18022d081ea2741fb /clang/lib/Frontend
parent7d633068870fde2a05596e9efa3b5ff4d9ad7097 (diff)
downloadllvm-4567c11d284fe404df80fb3293dac3e2aa85b79e.zip
llvm-4567c11d284fe404df80fb3293dac3e2aa85b79e.tar.gz
llvm-4567c11d284fe404df80fb3293dac3e2aa85b79e.tar.bz2
[clang] Use llvm::binary_search (NFC) (#140216)
Diffstat (limited to 'clang/lib/Frontend')
-rw-r--r--clang/lib/Frontend/DiagnosticRenderer.cpp3
-rw-r--r--clang/lib/Frontend/VerifyDiagnosticConsumer.cpp2
2 files changed, 2 insertions, 3 deletions
diff --git a/clang/lib/Frontend/DiagnosticRenderer.cpp b/clang/lib/Frontend/DiagnosticRenderer.cpp
index b118066..3b120ab 100644
--- a/clang/lib/Frontend/DiagnosticRenderer.cpp
+++ b/clang/lib/Frontend/DiagnosticRenderer.cpp
@@ -272,8 +272,7 @@ retrieveMacroLocation(SourceLocation Loc, FileID MacroFileID,
if (SM->isMacroArgExpansion(Loc)) {
// Only look at the immediate spelling location of this macro argument if
// the other location in the source range is also present in that expansion.
- if (std::binary_search(CommonArgExpansions.begin(),
- CommonArgExpansions.end(), MacroFileID))
+ if (llvm::binary_search(CommonArgExpansions, MacroFileID))
MacroRange =
CharSourceRange(SM->getImmediateSpellingLoc(Loc), IsTokenRange);
MacroArgRange = SM->getImmediateExpansionRange(Loc);
diff --git a/clang/lib/Frontend/VerifyDiagnosticConsumer.cpp b/clang/lib/Frontend/VerifyDiagnosticConsumer.cpp
index 6de19d6..89fda3e 100644
--- a/clang/lib/Frontend/VerifyDiagnosticConsumer.cpp
+++ b/clang/lib/Frontend/VerifyDiagnosticConsumer.cpp
@@ -482,7 +482,7 @@ static bool ParseDirective(StringRef S, ExpectedData *ED, SourceManager &SM,
// What's left in DToken is the actual prefix. That might not be a -verify
// prefix even if there is only one -verify prefix (for example, the full
// DToken is foo-bar-warning, but foo is the only -verify prefix).
- if (!std::binary_search(Prefixes.begin(), Prefixes.end(), DToken))
+ if (!llvm::binary_search(Prefixes, DToken))
continue;
if (NoDiag) {