From c18740976e53e847892ffcbc5278c4c7789a1289 Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Wed, 15 May 2019 05:31:14 +0000 Subject: [PATCH] Mark private unimplemented functions as deleted Applies modernize-use-equals-delete to the LLDB code base and removes the now redundant comments. llvm-svn: 360751 --- lldb/include/lldb/Breakpoint/StoppointLocation.h | 2 +- lldb/include/lldb/Host/macosx/HostInfoMacOSX.h | 4 ++-- lldb/include/lldb/Symbol/Variable.h | 4 ++-- lldb/include/lldb/Target/QueueList.h | 2 +- lldb/include/lldb/Target/ThreadList.h | 2 +- lldb/include/lldb/Target/UnwindAssembly.h | 2 +- lldb/include/lldb/Utility/Event.h | 2 +- lldb/include/lldb/Utility/SharingPtr.h | 14 ++++++-------- lldb/source/Host/macosx/cfcpp/CFCBundle.h | 4 ++-- lldb/tools/debugserver/source/MacOSX/MachTask.h | 4 ++-- lldb/tools/debugserver/source/PThreadEvent.h | 4 ++-- lldb/tools/debugserver/source/PseudoTerminal.h | 5 ++--- lldb/tools/debugserver/source/RNBContext.h | 5 ++--- lldb/tools/debugserver/source/RNBRemote.h | 3 +-- lldb/tools/debugserver/source/RNBSocket.h | 3 +-- 15 files changed, 27 insertions(+), 33 deletions(-) diff --git a/lldb/include/lldb/Breakpoint/StoppointLocation.h b/lldb/include/lldb/Breakpoint/StoppointLocation.h index 906cef5..3926f45 100644 --- a/lldb/include/lldb/Breakpoint/StoppointLocation.h +++ b/lldb/include/lldb/Breakpoint/StoppointLocation.h @@ -78,7 +78,7 @@ protected: private: // For StoppointLocation only DISALLOW_COPY_AND_ASSIGN(StoppointLocation); - StoppointLocation(); // Disallow default constructor + StoppointLocation() = delete; }; } // namespace lldb_private diff --git a/lldb/include/lldb/Host/macosx/HostInfoMacOSX.h b/lldb/include/lldb/Host/macosx/HostInfoMacOSX.h index d591776..d49e27a 100644 --- a/lldb/include/lldb/Host/macosx/HostInfoMacOSX.h +++ b/lldb/include/lldb/Host/macosx/HostInfoMacOSX.h @@ -22,8 +22,8 @@ class HostInfoMacOSX : public HostInfoPosix { private: // Static class, unconstructable. - HostInfoMacOSX(); - ~HostInfoMacOSX(); + HostInfoMacOSX() = delete; + ~HostInfoMacOSX() = delete; public: static llvm::VersionTuple GetOSVersion(); diff --git a/lldb/include/lldb/Symbol/Variable.h b/lldb/include/lldb/Symbol/Variable.h index ea46df7..12daecf 100644 --- a/lldb/include/lldb/Symbol/Variable.h +++ b/lldb/include/lldb/Symbol/Variable.h @@ -128,8 +128,8 @@ protected: m_static_member : 1; // Non-zero if variable is static member of a class // or struct. private: - Variable(const Variable &rhs); - Variable &operator=(const Variable &rhs); + Variable(const Variable &rhs) = delete; + Variable &operator=(const Variable &rhs) = delete; }; } // namespace lldb_private diff --git a/lldb/include/lldb/Target/QueueList.h b/lldb/include/lldb/Target/QueueList.h index 7029fa2..761107e 100644 --- a/lldb/include/lldb/Target/QueueList.h +++ b/lldb/include/lldb/Target/QueueList.h @@ -102,7 +102,7 @@ protected: std::mutex m_mutex; private: - QueueList(); + QueueList() = delete; }; } // namespace lldb_private diff --git a/lldb/include/lldb/Target/ThreadList.h b/lldb/include/lldb/Target/ThreadList.h index dcbd9aa..64ddf5a 100644 --- a/lldb/include/lldb/Target/ThreadList.h +++ b/lldb/include/lldb/Target/ThreadList.h @@ -151,7 +151,7 @@ protected: std::vector m_expression_tid_stack; private: - ThreadList(); + ThreadList() = delete; }; } // namespace lldb_private diff --git a/lldb/include/lldb/Target/UnwindAssembly.h b/lldb/include/lldb/Target/UnwindAssembly.h index 7c42df2..a70aef6 100644 --- a/lldb/include/lldb/Target/UnwindAssembly.h +++ b/lldb/include/lldb/Target/UnwindAssembly.h @@ -44,7 +44,7 @@ protected: ArchSpec m_arch; private: - UnwindAssembly(); // Outlaw default constructor + UnwindAssembly() = delete; DISALLOW_COPY_AND_ASSIGN(UnwindAssembly); }; diff --git a/lldb/include/lldb/Utility/Event.h b/lldb/include/lldb/Utility/Event.h index c0e4e97..3743c64 100644 --- a/lldb/include/lldb/Utility/Event.h +++ b/lldb/include/lldb/Utility/Event.h @@ -245,7 +245,7 @@ private: lldb::EventDataSP m_data_sp; // User specific data for this event DISALLOW_COPY_AND_ASSIGN(Event); - Event(); // Disallow default constructor + Event() = delete; }; } // namespace lldb_private diff --git a/lldb/include/lldb/Utility/SharingPtr.h b/lldb/include/lldb/Utility/SharingPtr.h index 5515103..e4ab3d2 100644 --- a/lldb/include/lldb/Utility/SharingPtr.h +++ b/lldb/include/lldb/Utility/SharingPtr.h @@ -35,8 +35,8 @@ namespace lldb_private { namespace imp { class shared_count { - shared_count(const shared_count &); - shared_count &operator=(const shared_count &); + shared_count(const shared_count &) = delete; + shared_count &operator=(const shared_count &) = delete; public: explicit shared_count(long refs = 0) : shared_owners_(refs) {} @@ -66,10 +66,8 @@ public: private: void on_zero_shared() override; - // Outlaw copy constructor and assignment operator to keep effective C++ - // warnings down to a minimum - shared_ptr_pointer(const shared_ptr_pointer &); - shared_ptr_pointer &operator=(const shared_ptr_pointer &); + shared_ptr_pointer(const shared_ptr_pointer &) = delete; + shared_ptr_pointer &operator=(const shared_ptr_pointer &) = delete; }; template void shared_ptr_pointer::on_zero_shared() { @@ -455,8 +453,8 @@ protected: friend class IntrusiveSharingPtr; private: - ReferenceCountedBase(const ReferenceCountedBase &); - ReferenceCountedBase &operator=(const ReferenceCountedBase &); + ReferenceCountedBase(const ReferenceCountedBase &) = delete; + ReferenceCountedBase &operator=(const ReferenceCountedBase &) = delete; }; template void lldb_private::ReferenceCountedBase::add_shared() { diff --git a/lldb/source/Host/macosx/cfcpp/CFCBundle.h b/lldb/source/Host/macosx/cfcpp/CFCBundle.h index 9ff58fb..014552a 100644 --- a/lldb/source/Host/macosx/cfcpp/CFCBundle.h +++ b/lldb/source/Host/macosx/cfcpp/CFCBundle.h @@ -31,9 +31,9 @@ public: private: // Disallow copy and assignment constructors - CFCBundle(const CFCBundle &); + CFCBundle(const CFCBundle &) = delete; - const CFCBundle &operator=(const CFCBundle &); + const CFCBundle &operator=(const CFCBundle &) = delete; }; #endif // #ifndef CoreFoundationCPP_CFBundle_h_ diff --git a/lldb/tools/debugserver/source/MacOSX/MachTask.h b/lldb/tools/debugserver/source/MacOSX/MachTask.h index a933bff..c975e15 100644 --- a/lldb/tools/debugserver/source/MacOSX/MachTask.h +++ b/lldb/tools/debugserver/source/MacOSX/MachTask.h @@ -102,8 +102,8 @@ protected: allocation_collection m_allocations; private: - MachTask(const MachTask &); // Outlaw - MachTask &operator=(const MachTask &rhs); // Outlaw + MachTask(const MachTask &) = delete; + MachTask &operator=(const MachTask &rhs) = delete; }; #endif // __MachTask_h__ diff --git a/lldb/tools/debugserver/source/PThreadEvent.h b/lldb/tools/debugserver/source/PThreadEvent.h index 5689cbf..f81798d 100644 --- a/lldb/tools/debugserver/source/PThreadEvent.h +++ b/lldb/tools/debugserver/source/PThreadEvent.h @@ -54,8 +54,8 @@ protected: uint32_t m_reset_ack_mask; private: - PThreadEvent(const PThreadEvent &); // Outlaw copy constructor - PThreadEvent &operator=(const PThreadEvent &rhs); + PThreadEvent(const PThreadEvent &) = delete; + PThreadEvent &operator=(const PThreadEvent &rhs) = delete; }; #endif // #ifndef __PThreadEvent_h__ diff --git a/lldb/tools/debugserver/source/PseudoTerminal.h b/lldb/tools/debugserver/source/PseudoTerminal.h index e4093bd..e3324c1 100644 --- a/lldb/tools/debugserver/source/PseudoTerminal.h +++ b/lldb/tools/debugserver/source/PseudoTerminal.h @@ -72,9 +72,8 @@ protected: int m_slave_fd; private: - // Outlaw copy and assignment constructors - PseudoTerminal(const PseudoTerminal &rhs); - PseudoTerminal &operator=(const PseudoTerminal &rhs); + PseudoTerminal(const PseudoTerminal &rhs) = delete; + PseudoTerminal &operator=(const PseudoTerminal &rhs) = delete; }; #endif // #ifndef __PseudoTerminal_h__ diff --git a/lldb/tools/debugserver/source/RNBContext.h b/lldb/tools/debugserver/source/RNBContext.h index 9159057..946dfb2 100644 --- a/lldb/tools/debugserver/source/RNBContext.h +++ b/lldb/tools/debugserver/source/RNBContext.h @@ -149,9 +149,8 @@ protected: static void *ThreadFunctionProcessStatus(void *arg); private: - // Outlaw copy and assignment operators - RNBContext(const RNBContext &rhs); - RNBContext &operator=(const RNBContext &rhs); + RNBContext(const RNBContext &rhs) = delete; + RNBContext &operator=(const RNBContext &rhs) = delete; }; #endif // #ifndef __RNBContext_h__ diff --git a/lldb/tools/debugserver/source/RNBRemote.h b/lldb/tools/debugserver/source/RNBRemote.h index 1fb309b..88d8209 100644 --- a/lldb/tools/debugserver/source/RNBRemote.h +++ b/lldb/tools/debugserver/source/RNBRemote.h @@ -264,8 +264,7 @@ public: RNBSocket &Comm() { return m_comm; } private: - // Outlaw some constructors - RNBRemote(const RNBRemote &); + RNBRemote(const RNBRemote &) = delete; protected: rnb_err_t GetCommData(); diff --git a/lldb/tools/debugserver/source/RNBSocket.h b/lldb/tools/debugserver/source/RNBSocket.h index da6c6d8..2f68eb0 100644 --- a/lldb/tools/debugserver/source/RNBSocket.h +++ b/lldb/tools/debugserver/source/RNBSocket.h @@ -59,8 +59,7 @@ public: int option_value); private: - // Outlaw some constructors - RNBSocket(const RNBSocket &); + RNBSocket(const RNBSocket &) = delete; protected: rnb_err_t ClosePort(int &fd, bool save_errno); -- 2.7.4