llvmbot wrote:

<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang-format

Author: Kazu Hirata (kazutakahirata)

<details>
<summary>Changes</summary>



---
Full diff: https://github.com/llvm/llvm-project/pull/140216.diff


6 Files Affected:

- (modified) clang/include/clang/StaticAnalyzer/Core/AnalyzerOptions.h (+1-2) 
- (modified) clang/lib/Format/Format.cpp (+2-3) 
- (modified) clang/lib/Format/FormatToken.cpp (+1-2) 
- (modified) clang/lib/Frontend/DiagnosticRenderer.cpp (+1-2) 
- (modified) clang/lib/Frontend/VerifyDiagnosticConsumer.cpp (+1-1) 
- (modified) clang/lib/Lex/PPDirectives.cpp (+1-2) 


``````````diff
diff --git a/clang/include/clang/StaticAnalyzer/Core/AnalyzerOptions.h 
b/clang/include/clang/StaticAnalyzer/Core/AnalyzerOptions.h
index 543ac8ab2ab12..7d0c2d8658f35 100644
--- a/clang/include/clang/StaticAnalyzer/Core/AnalyzerOptions.h
+++ b/clang/include/clang/StaticAnalyzer/Core/AnalyzerOptions.h
@@ -311,8 +311,7 @@ class AnalyzerOptions {
       return AnalyzerConfigCmdFlags;
     }();
 
-    return !std::binary_search(AnalyzerConfigCmdFlags.begin(),
-                               AnalyzerConfigCmdFlags.end(), Name);
+    return !llvm::binary_search(AnalyzerConfigCmdFlags, Name);
   }
 
   AnalyzerOptions()
diff --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp
index 20b5352b83a9e..7e32d2084d5ab 100644
--- a/clang/lib/Format/Format.cpp
+++ b/clang/lib/Format/Format.cpp
@@ -3091,9 +3091,8 @@ class ObjCHeaderStyleGuesser : public TokenAnalyzer {
               FormatTok->isOneOf(tok::numeric_constant, tok::l_square,
                                  tok::l_brace))) ||
             (FormatTok->Tok.isAnyIdentifier() &&
-             std::binary_search(std::begin(FoundationIdentifiers),
-                                std::end(FoundationIdentifiers),
-                                FormatTok->TokenText)) ||
+             llvm::binary_search(FoundationIdentifiers,
+                                 FormatTok->TokenText)) ||
             FormatTok->is(TT_ObjCStringLiteral) ||
             FormatTok->isOneOf(Keywords.kw_NS_CLOSED_ENUM, Keywords.kw_NS_ENUM,
                                Keywords.kw_NS_ERROR_ENUM,
diff --git a/clang/lib/Format/FormatToken.cpp b/clang/lib/Format/FormatToken.cpp
index 1d49d787f9cc9..e0867f6dcce06 100644
--- a/clang/lib/Format/FormatToken.cpp
+++ b/clang/lib/Format/FormatToken.cpp
@@ -45,8 +45,7 @@ bool FormatToken::isTypeName(const LangOptions &LangOpts) 
const {
   if (is(TT_TypeName) || Tok.isSimpleTypeSpecifier(LangOpts))
     return true;
   return (LangOpts.CXXOperatorNames || LangOpts.C11) && is(tok::identifier) &&
-         std::binary_search(CppNonKeywordTypes.begin(),
-                            CppNonKeywordTypes.end(), TokenText);
+         llvm::binary_search(CppNonKeywordTypes, TokenText);
 }
 
 bool FormatToken::isTypeOrIdentifier(const LangOptions &LangOpts) const {
diff --git a/clang/lib/Frontend/DiagnosticRenderer.cpp 
b/clang/lib/Frontend/DiagnosticRenderer.cpp
index b11806637efda..3b120abbc3a7a 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 6de19d689988e..89fda3e839cb9 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) {
diff --git a/clang/lib/Lex/PPDirectives.cpp b/clang/lib/Lex/PPDirectives.cpp
index c2bab9118234c..b2a8459d6b9cc 100644
--- a/clang/lib/Lex/PPDirectives.cpp
+++ b/clang/lib/Lex/PPDirectives.cpp
@@ -148,8 +148,7 @@ static bool isFeatureTestMacro(StringRef MacroName) {
       "__STDCPP_WANT_MATH_SPEC_FUNCS__",
       "__STDC_FORMAT_MACROS",
   };
-  return std::binary_search(std::begin(ReservedMacro), std::end(ReservedMacro),
-                            MacroName);
+  return llvm::binary_search(ReservedMacro, MacroName);
 }
 
 static bool isLanguageDefinedBuiltin(const SourceManager &SourceMgr,

``````````

</details>


https://github.com/llvm/llvm-project/pull/140216
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to