aboutsummaryrefslogtreecommitdiff
path: root/lldb
diff options
context:
space:
mode:
authorDmitri Gribenko <gribozavr@gmail.com>2022-07-23 15:07:49 +0200
committerDmitri Gribenko <gribozavr@gmail.com>2022-07-23 15:13:25 +0200
commitcd9a5cfd2e4e4d583c9bf5ef1100acaf5e96f29e (patch)
treec5068be09b26633a36772ed5786e1fb5441e3b00 /lldb
parent[DAG] Move OR(AND(X,C1),AND(OR(X,Y),C2)) -> OR(AND(X,OR(C1,C2)),AND(Y,C2)) fo... (diff)
downloadllvm-project-cd9a5cfd2e4e4d583c9bf5ef1100acaf5e96f29e.tar.gz
llvm-project-cd9a5cfd2e4e4d583c9bf5ef1100acaf5e96f29e.tar.bz2
llvm-project-cd9a5cfd2e4e4d583c9bf5ef1100acaf5e96f29e.zip
Use the range-based overload of llvm::sort where possible
Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D130403
Diffstat (limited to 'lldb')
-rw-r--r--lldb/source/Interpreter/OptionValueArray.cpp2
-rw-r--r--lldb/source/Interpreter/OptionValueFileSpecList.cpp2
-rw-r--r--lldb/source/Interpreter/OptionValuePathMappings.cpp2
-rw-r--r--lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp7
-rw-r--r--lldb/source/Symbol/ArmUnwindInfo.cpp2
-rw-r--r--lldb/source/Symbol/CompileUnit.cpp2
-rw-r--r--lldb/source/Symbol/Symtab.cpp2
-rw-r--r--lldb/source/Target/DynamicRegisterInfo.cpp2
-rw-r--r--lldb/source/Target/Target.cpp2
-rw-r--r--lldb/source/Utility/ReproducerProvider.cpp2
-rw-r--r--lldb/source/Utility/Timer.cpp2
11 files changed, 13 insertions, 14 deletions
diff --git a/lldb/source/Interpreter/OptionValueArray.cpp b/lldb/source/Interpreter/OptionValueArray.cpp
index 4468fe57702e..c202a188fe2a 100644
--- a/lldb/source/Interpreter/OptionValueArray.cpp
+++ b/lldb/source/Interpreter/OptionValueArray.cpp
@@ -218,7 +218,7 @@ Status OptionValueArray::SetArgs(const Args &args, VarSetOperationType op) {
if (num_remove_indexes) {
// Sort and then erase in reverse so indexes are always valid
if (num_remove_indexes > 1) {
- llvm::sort(remove_indexes.begin(), remove_indexes.end());
+ llvm::sort(remove_indexes);
for (std::vector<int>::const_reverse_iterator
pos = remove_indexes.rbegin(),
end = remove_indexes.rend();
diff --git a/lldb/source/Interpreter/OptionValueFileSpecList.cpp b/lldb/source/Interpreter/OptionValueFileSpecList.cpp
index 6566eee09d73..9b4114e2ceb2 100644
--- a/lldb/source/Interpreter/OptionValueFileSpecList.cpp
+++ b/lldb/source/Interpreter/OptionValueFileSpecList.cpp
@@ -137,7 +137,7 @@ Status OptionValueFileSpecList::SetValueFromString(llvm::StringRef value,
size_t num_remove_indexes = remove_indexes.size();
if (num_remove_indexes) {
// Sort and then erase in reverse so indexes are always valid
- llvm::sort(remove_indexes.begin(), remove_indexes.end());
+ llvm::sort(remove_indexes);
for (size_t j = num_remove_indexes - 1; j < num_remove_indexes; ++j) {
m_current_value.Remove(j);
}
diff --git a/lldb/source/Interpreter/OptionValuePathMappings.cpp b/lldb/source/Interpreter/OptionValuePathMappings.cpp
index 543b0e1b8ea8..6096f4564629 100644
--- a/lldb/source/Interpreter/OptionValuePathMappings.cpp
+++ b/lldb/source/Interpreter/OptionValuePathMappings.cpp
@@ -174,7 +174,7 @@ Status OptionValuePathMappings::SetValueFromString(llvm::StringRef value,
}
// Sort and then erase in reverse so indexes are always valid
- llvm::sort(remove_indexes.begin(), remove_indexes.end());
+ llvm::sort(remove_indexes);
for (auto index : llvm::reverse(remove_indexes))
m_path_mappings.Remove(index, m_notify_changes);
NotifyValueChanged();
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp
index 1bf29efb0bee..f8443d608ac3 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp
@@ -1430,10 +1430,9 @@ static bool ImportOffsetMap(llvm::DenseMap<const D *, O> &destination_map,
std::vector<PairType> sorted_items;
sorted_items.reserve(source_map.size());
sorted_items.assign(source_map.begin(), source_map.end());
- llvm::sort(sorted_items.begin(), sorted_items.end(),
- [](const PairType &lhs, const PairType &rhs) {
- return lhs.second < rhs.second;
- });
+ llvm::sort(sorted_items, [](const PairType &lhs, const PairType &rhs) {
+ return lhs.second < rhs.second;
+ });
for (const auto &item : sorted_items) {
DeclFromUser<D> user_decl(const_cast<D *>(item.first));
diff --git a/lldb/source/Symbol/ArmUnwindInfo.cpp b/lldb/source/Symbol/ArmUnwindInfo.cpp
index 07852485f44e..ae6cddfbc463 100644
--- a/lldb/source/Symbol/ArmUnwindInfo.cpp
+++ b/lldb/source/Symbol/ArmUnwindInfo.cpp
@@ -65,7 +65,7 @@ ArmUnwindInfo::ArmUnwindInfo(ObjectFile &objfile, SectionSP &arm_exidx,
// Sort the entries in the exidx section. The entries should be sorted inside
// the section but some old compiler isn't sorted them.
- llvm::sort(m_exidx_entries.begin(), m_exidx_entries.end());
+ llvm::sort(m_exidx_entries);
}
ArmUnwindInfo::~ArmUnwindInfo() = default;
diff --git a/lldb/source/Symbol/CompileUnit.cpp b/lldb/source/Symbol/CompileUnit.cpp
index cacb78de2426..2bae08c8b930 100644
--- a/lldb/source/Symbol/CompileUnit.cpp
+++ b/lldb/source/Symbol/CompileUnit.cpp
@@ -63,7 +63,7 @@ void CompileUnit::ForeachFunction(
sorted_functions.reserve(m_functions_by_uid.size());
for (auto &p : m_functions_by_uid)
sorted_functions.push_back(p.second);
- llvm::sort(sorted_functions.begin(), sorted_functions.end(),
+ llvm::sort(sorted_functions,
[](const lldb::FunctionSP &a, const lldb::FunctionSP &b) {
return a->GetID() < b->GetID();
});
diff --git a/lldb/source/Symbol/Symtab.cpp b/lldb/source/Symbol/Symtab.cpp
index eb2447efbad1..936ee04ed492 100644
--- a/lldb/source/Symbol/Symtab.cpp
+++ b/lldb/source/Symbol/Symtab.cpp
@@ -1137,7 +1137,7 @@ void Symtab::FindFunctionSymbols(ConstString name, uint32_t name_type_mask,
}
if (!symbol_indexes.empty()) {
- llvm::sort(symbol_indexes.begin(), symbol_indexes.end());
+ llvm::sort(symbol_indexes);
symbol_indexes.erase(
std::unique(symbol_indexes.begin(), symbol_indexes.end()),
symbol_indexes.end());
diff --git a/lldb/source/Target/DynamicRegisterInfo.cpp b/lldb/source/Target/DynamicRegisterInfo.cpp
index e2962b02ed7f..14c3faae38df 100644
--- a/lldb/source/Target/DynamicRegisterInfo.cpp
+++ b/lldb/source/Target/DynamicRegisterInfo.cpp
@@ -483,7 +483,7 @@ void DynamicRegisterInfo::Finalize(const ArchSpec &arch) {
end = m_invalidate_regs_map.end();
pos != end; ++pos) {
if (pos->second.size() > 1) {
- llvm::sort(pos->second.begin(), pos->second.end());
+ llvm::sort(pos->second);
reg_num_collection::iterator unique_end =
std::unique(pos->second.begin(), pos->second.end());
if (unique_end != pos->second.end())
diff --git a/lldb/source/Target/Target.cpp b/lldb/source/Target/Target.cpp
index 292ace6d754c..6ffe6d3926ad 100644
--- a/lldb/source/Target/Target.cpp
+++ b/lldb/source/Target/Target.cpp
@@ -776,7 +776,7 @@ void Target::GetBreakpointNames(std::vector<std::string> &names) {
for (auto bp_name : m_breakpoint_names) {
names.push_back(bp_name.first.AsCString());
}
- llvm::sort(names.begin(), names.end());
+ llvm::sort(names);
}
bool Target::ProcessIsValid() {
diff --git a/lldb/source/Utility/ReproducerProvider.cpp b/lldb/source/Utility/ReproducerProvider.cpp
index 0d1581abda64..44f24e44f38d 100644
--- a/lldb/source/Utility/ReproducerProvider.cpp
+++ b/lldb/source/Utility/ReproducerProvider.cpp
@@ -131,7 +131,7 @@ void SymbolFileProvider::Keep() {
return;
// Remove duplicates.
- llvm::sort(m_symbol_files.begin(), m_symbol_files.end());
+ llvm::sort(m_symbol_files);
m_symbol_files.erase(
std::unique(m_symbol_files.begin(), m_symbol_files.end()),
m_symbol_files.end());
diff --git a/lldb/source/Utility/Timer.cpp b/lldb/source/Utility/Timer.cpp
index b190f35007d5..477541d7bb3d 100644
--- a/lldb/source/Utility/Timer.cpp
+++ b/lldb/source/Utility/Timer.cpp
@@ -150,7 +150,7 @@ void Timer::DumpCategoryTimes(Stream *s) {
return; // Later code will break without any elements.
// Sort by time
- llvm::sort(sorted.begin(), sorted.end(), CategoryMapIteratorSortCriterion);
+ llvm::sort(sorted, CategoryMapIteratorSortCriterion);
for (const auto &stats : sorted)
s->Printf("%.9f sec (total: %.3fs; child: %.3fs; count: %" PRIu64