Skip to content
Snippets Groups Projects
Commit f686213d authored by Craig Topper's avatar Craig Topper
Browse files

Replace a static compare function with a lambda. NFC

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@250621 91177308-0d34-0410-b5e6-96231b3b80d8
parent 067bdf15
No related branches found
No related tags found
No related merge requests found
...@@ -503,10 +503,6 @@ static const WarningOption OptionTable[] = { ...@@ -503,10 +503,6 @@ static const WarningOption OptionTable[] = {
#undef GET_DIAG_TABLE #undef GET_DIAG_TABLE
}; };
static bool WarningOptionCompare(const WarningOption &LHS, StringRef RHS) {
return LHS.getName() < RHS;
}
/// getWarningOptionForDiag - Return the lowest-level warning option that /// getWarningOptionForDiag - Return the lowest-level warning option that
/// enables the specified diagnostic. If there is no -Wfoo flag that controls /// enables the specified diagnostic. If there is no -Wfoo flag that controls
/// the diagnostic, this returns null. /// the diagnostic, this returns null.
...@@ -549,9 +545,11 @@ static bool getDiagnosticsInGroup(diag::Flavor Flavor, ...@@ -549,9 +545,11 @@ static bool getDiagnosticsInGroup(diag::Flavor Flavor,
bool bool
DiagnosticIDs::getDiagnosticsInGroup(diag::Flavor Flavor, StringRef Group, DiagnosticIDs::getDiagnosticsInGroup(diag::Flavor Flavor, StringRef Group,
SmallVectorImpl<diag::kind> &Diags) const { SmallVectorImpl<diag::kind> &Diags) const {
const WarningOption *Found = std::lower_bound(std::begin(OptionTable), auto Found = std::lower_bound(std::begin(OptionTable), std::end(OptionTable),
std::end(OptionTable), Group,
Group, WarningOptionCompare); [](const WarningOption &LHS, StringRef RHS) {
return LHS.getName() < RHS;
});
if (Found == std::end(OptionTable) || Found->getName() != Group) if (Found == std::end(OptionTable) || Found->getName() != Group)
return true; // Option not found. return true; // Option not found.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment