Make more use of llvm STLExtras (#4668)

This is essentially the result of looking at `.begin()` uses. We also
frequently do `std::shuffle`, but unfortunately STLExtras doesn't
provide a wrapper for that.
This commit is contained in:
Jon Ross-Perkins
2024-12-11 18:16:38 +00:00
committed by GitHub
parent 47285b6207
commit 61c0a8b676
15 changed files with 52 additions and 64 deletions
+3 -4
View File
@@ -1070,10 +1070,9 @@ auto Parser::FinalizeParsedOptions() -> ErrorOr<Success> {
// Sort the missing arguments by name to provide a stable and deterministic
// error message. We know there can't be duplicate names because these came
// from a may keyed on the name, so this provides a total ordering.
std::sort(missing_options.begin(), missing_options.end(),
[](const Arg* lhs, const Arg* rhs) {
return lhs->info.name < rhs->info.name;
});
llvm::sort(missing_options, [](const Arg* lhs, const Arg* rhs) {
return lhs->info.name < rhs->info.name;
});
std::string error_str = "required options not provided: ";
llvm::raw_string_ostream error(error_str);