From 6dc2a6a8c9a0e4f8b46a0ba05430b77229789b8e Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Mon, 10 May 2021 14:28:09 -0700 Subject: [PATCH] Remove some unnecessary explicit defaulted copy ctors to cleanup -Wdeprecated-copy These types also wanted to be/were copy assignable, and using the implicit copy ctor is deprecated in the presence of an explicit copy ctor. Removing the explicit copy ctor provides the desired behavior - both ctor and assignment operator are available implicitly. Also while I was nearby there were some missing std::moves on shared pointer parameters. --- lldb/include/lldb/DataFormatters/DumpValueObjectOptions.h | 2 -- lldb/include/lldb/Symbol/UnwindPlan.h | 2 -- lldb/include/lldb/Utility/Timeout.h | 1 - lldb/source/Plugins/Language/CPlusPlus/LibCxxList.cpp | 8 +++----- lldb/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp | 7 +++---- 5 files changed, 6 insertions(+), 14 deletions(-) diff --git a/lldb/include/lldb/DataFormatters/DumpValueObjectOptions.h b/lldb/include/lldb/DataFormatters/DumpValueObjectOptions.h index 2f3bdf8..4d54f03 100644 --- a/lldb/include/lldb/DataFormatters/DumpValueObjectOptions.h +++ b/lldb/include/lldb/DataFormatters/DumpValueObjectOptions.h @@ -62,8 +62,6 @@ public: DumpValueObjectOptions(); - DumpValueObjectOptions(const DumpValueObjectOptions &rhs) = default; - DumpValueObjectOptions(ValueObject &valobj); DumpValueObjectOptions & diff --git a/lldb/include/lldb/Symbol/UnwindPlan.h b/lldb/include/lldb/Symbol/UnwindPlan.h index 06c76ca..f8d23d7 100644 --- a/lldb/include/lldb/Symbol/UnwindPlan.h +++ b/lldb/include/lldb/Symbol/UnwindPlan.h @@ -322,8 +322,6 @@ public: Row(); - Row(const UnwindPlan::Row &rhs) = default; - bool operator==(const Row &rhs) const; bool GetRegisterInfo(uint32_t reg_num, diff --git a/lldb/include/lldb/Utility/Timeout.h b/lldb/include/lldb/Utility/Timeout.h index 80e2015..29f8c1b 100644 --- a/lldb/include/lldb/Utility/Timeout.h +++ b/lldb/include/lldb/Utility/Timeout.h @@ -37,7 +37,6 @@ private: public: Timeout(llvm::NoneType none) : Base(none) {} - Timeout(const Timeout &other) = default; template ::type> diff --git a/lldb/source/Plugins/Language/CPlusPlus/LibCxxList.cpp b/lldb/source/Plugins/Language/CPlusPlus/LibCxxList.cpp index 0d5ae16..47c6634 100644 --- a/lldb/source/Plugins/Language/CPlusPlus/LibCxxList.cpp +++ b/lldb/source/Plugins/Language/CPlusPlus/LibCxxList.cpp @@ -27,8 +27,7 @@ namespace { class ListEntry { public: ListEntry() = default; - ListEntry(ValueObjectSP entry_sp) : m_entry_sp(entry_sp) {} - ListEntry(const ListEntry &rhs) = default; + ListEntry(ValueObjectSP entry_sp) : m_entry_sp(std::move(entry_sp)) {} ListEntry(ValueObject *entry) : m_entry_sp(entry ? entry->GetSP() : ValueObjectSP()) {} @@ -73,9 +72,8 @@ private: class ListIterator { public: ListIterator() = default; - ListIterator(ListEntry entry) : m_entry(entry) {} - ListIterator(ValueObjectSP entry) : m_entry(entry) {} - ListIterator(const ListIterator &rhs) = default; + ListIterator(ListEntry entry) : m_entry(std::move(entry)) {} + ListIterator(ValueObjectSP entry) : m_entry(std::move(entry)) {} ListIterator(ValueObject *entry) : m_entry(entry) {} ValueObjectSP value() { return m_entry.GetEntry(); } diff --git a/lldb/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp b/lldb/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp index 64a199e..25c2bfd 100644 --- a/lldb/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp +++ b/lldb/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp @@ -26,7 +26,6 @@ class MapEntry { public: MapEntry() = default; explicit MapEntry(ValueObjectSP entry_sp) : m_entry_sp(entry_sp) {} - MapEntry(const MapEntry &rhs) = default; explicit MapEntry(ValueObject *entry) : m_entry_sp(entry ? entry->GetSP() : ValueObjectSP()) {} @@ -86,9 +85,9 @@ class MapIterator { public: MapIterator() = default; MapIterator(MapEntry entry, size_t depth = 0) - : m_entry(entry), m_max_depth(depth), m_error(false) {} + : m_entry(std::move(entry)), m_max_depth(depth), m_error(false) {} MapIterator(ValueObjectSP entry, size_t depth = 0) - : m_entry(entry), m_max_depth(depth), m_error(false) {} + : m_entry(std::move(entry)), m_max_depth(depth), m_error(false) {} MapIterator(const MapIterator &rhs) : m_entry(rhs.m_entry), m_max_depth(rhs.m_max_depth), m_error(false) {} MapIterator(ValueObject *entry, size_t depth = 0) @@ -138,7 +137,7 @@ protected: } private: - MapEntry tree_min(MapEntry &&x) { + MapEntry tree_min(MapEntry x) { if (x.null()) return MapEntry(); MapEntry left(x.left()); -- 2.7.4