Skip to content

Commit

Permalink
Remove some unnecessary explicit defaulted copy ctors to cleanup -Wde…
Browse files Browse the repository at this point in the history
…precated-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.
  • Loading branch information
dwblaikie committed May 10, 2021
1 parent 5577e86 commit 6dc2a6a
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 14 deletions.
2 changes: 0 additions & 2 deletions lldb/include/lldb/DataFormatters/DumpValueObjectOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ class DumpValueObjectOptions {

DumpValueObjectOptions();

DumpValueObjectOptions(const DumpValueObjectOptions &rhs) = default;

DumpValueObjectOptions(ValueObject &valobj);

DumpValueObjectOptions &
Expand Down
2 changes: 0 additions & 2 deletions lldb/include/lldb/Symbol/UnwindPlan.h
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,6 @@ class UnwindPlan {

Row();

Row(const UnwindPlan::Row &rhs) = default;

bool operator==(const Row &rhs) const;

bool GetRegisterInfo(uint32_t reg_num,
Expand Down
1 change: 0 additions & 1 deletion lldb/include/lldb/Utility/Timeout.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ class Timeout : public llvm::Optional<std::chrono::duration<int64_t, Ratio>> {

public:
Timeout(llvm::NoneType none) : Base(none) {}
Timeout(const Timeout &other) = default;

template <typename Ratio2,
typename = typename EnableIf<int64_t, Ratio2>::type>
Expand Down
8 changes: 3 additions & 5 deletions lldb/source/Plugins/Language/CPlusPlus/LibCxxList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {}

Expand Down Expand Up @@ -73,9 +72,8 @@ class ListEntry {
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(); }
Expand Down
7 changes: 3 additions & 4 deletions lldb/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {}

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -138,7 +137,7 @@ class MapIterator {
}

private:
MapEntry tree_min(MapEntry &&x) {
MapEntry tree_min(MapEntry x) {
if (x.null())
return MapEntry();
MapEntry left(x.left());
Expand Down

0 comments on commit 6dc2a6a

Please sign in to comment.