From ee4b6cf5387b1b9eef7f21ae93a868b1aded4b08 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Sun, 6 Feb 2022 10:54:46 -0800 Subject: [PATCH] [Breakpoint] Remove redundant member initialization (NFC) Identified with readability-redundant-member-init. --- lldb/source/Breakpoint/Breakpoint.cpp | 3 +-- lldb/source/Breakpoint/BreakpointList.cpp | 3 +-- lldb/source/Breakpoint/BreakpointLocation.cpp | 3 +-- .../Breakpoint/BreakpointLocationCollection.cpp | 3 +-- lldb/source/Breakpoint/BreakpointLocationList.cpp | 3 +-- lldb/source/Breakpoint/BreakpointOptions.cpp | 11 +++++------ lldb/source/Breakpoint/BreakpointResolverAddress.cpp | 3 +-- lldb/source/Breakpoint/BreakpointResolverName.cpp | 3 +-- lldb/source/Breakpoint/BreakpointSite.cpp | 6 +++--- lldb/source/Breakpoint/BreakpointSiteList.cpp | 2 +- lldb/source/Breakpoint/StoppointCallbackContext.cpp | 2 +- lldb/source/Breakpoint/Watchpoint.cpp | 6 ++---- lldb/source/Breakpoint/WatchpointList.cpp | 2 +- lldb/source/Breakpoint/WatchpointOptions.cpp | 6 ++---- 14 files changed, 22 insertions(+), 34 deletions(-) diff --git a/lldb/source/Breakpoint/Breakpoint.cpp b/lldb/source/Breakpoint/Breakpoint.cpp index 8cbc79c24370..050457986eba 100644 --- a/lldb/source/Breakpoint/Breakpoint.cpp +++ b/lldb/source/Breakpoint/Breakpoint.cpp @@ -1012,8 +1012,7 @@ void Breakpoint::SendBreakpointChangedEvent(BreakpointEventData *data) { Breakpoint::BreakpointEventData::BreakpointEventData( BreakpointEventType sub_type, const BreakpointSP &new_breakpoint_sp) - : EventData(), m_breakpoint_event(sub_type), - m_new_breakpoint_sp(new_breakpoint_sp) {} + : m_breakpoint_event(sub_type), m_new_breakpoint_sp(new_breakpoint_sp) {} Breakpoint::BreakpointEventData::~BreakpointEventData() = default; diff --git a/lldb/source/Breakpoint/BreakpointList.cpp b/lldb/source/Breakpoint/BreakpointList.cpp index ca181ee306a4..f4d4b2edbf08 100644 --- a/lldb/source/Breakpoint/BreakpointList.cpp +++ b/lldb/source/Breakpoint/BreakpointList.cpp @@ -23,8 +23,7 @@ static void NotifyChange(const BreakpointSP &bp, BreakpointEventType event) { } BreakpointList::BreakpointList(bool is_internal) - : m_mutex(), m_breakpoints(), m_next_break_id(0), - m_is_internal(is_internal) {} + : m_next_break_id(0), m_is_internal(is_internal) {} BreakpointList::~BreakpointList() = default; diff --git a/lldb/source/Breakpoint/BreakpointLocation.cpp b/lldb/source/Breakpoint/BreakpointLocation.cpp index 0b73d7cc890d..0ee8bcf491ea 100644 --- a/lldb/source/Breakpoint/BreakpointLocation.cpp +++ b/lldb/source/Breakpoint/BreakpointLocation.cpp @@ -34,8 +34,7 @@ BreakpointLocation::BreakpointLocation(break_id_t loc_id, Breakpoint &owner, bool hardware, bool check_for_resolver) : m_being_created(true), m_should_resolve_indirect_functions(false), m_is_reexported(false), m_is_indirect(false), m_address(addr), - m_owner(owner), m_options_up(), m_bp_site_sp(), m_condition_mutex(), - m_condition_hash(0), m_loc_id(loc_id), m_hit_counter() { + m_owner(owner), m_condition_hash(0), m_loc_id(loc_id), m_hit_counter() { if (check_for_resolver) { Symbol *symbol = m_address.CalculateSymbolContextSymbol(); if (symbol && symbol->IsIndirect()) { diff --git a/lldb/source/Breakpoint/BreakpointLocationCollection.cpp b/lldb/source/Breakpoint/BreakpointLocationCollection.cpp index 6c55629b5aad..7efb2870e87e 100644 --- a/lldb/source/Breakpoint/BreakpointLocationCollection.cpp +++ b/lldb/source/Breakpoint/BreakpointLocationCollection.cpp @@ -17,8 +17,7 @@ using namespace lldb; using namespace lldb_private; // BreakpointLocationCollection constructor -BreakpointLocationCollection::BreakpointLocationCollection() - : m_break_loc_collection(), m_collection_mutex() {} +BreakpointLocationCollection::BreakpointLocationCollection() = default; // Destructor BreakpointLocationCollection::~BreakpointLocationCollection() = default; diff --git a/lldb/source/Breakpoint/BreakpointLocationList.cpp b/lldb/source/Breakpoint/BreakpointLocationList.cpp index 6d271864c445..46f66276d28d 100644 --- a/lldb/source/Breakpoint/BreakpointLocationList.cpp +++ b/lldb/source/Breakpoint/BreakpointLocationList.cpp @@ -20,8 +20,7 @@ using namespace lldb; using namespace lldb_private; BreakpointLocationList::BreakpointLocationList(Breakpoint &owner) - : m_owner(owner), m_locations(), m_address_to_location(), m_mutex(), - m_next_id(0), m_new_location_recorder(nullptr) {} + : m_owner(owner), m_next_id(0), m_new_location_recorder(nullptr) {} BreakpointLocationList::~BreakpointLocationList() = default; diff --git a/lldb/source/Breakpoint/BreakpointOptions.cpp b/lldb/source/Breakpoint/BreakpointOptions.cpp index 86a7c483df83..3dcb1904c8f8 100644 --- a/lldb/source/Breakpoint/BreakpointOptions.cpp +++ b/lldb/source/Breakpoint/BreakpointOptions.cpp @@ -121,11 +121,10 @@ bool BreakpointOptions::NullCallback(void *baton, // BreakpointOptions constructor BreakpointOptions::BreakpointOptions(bool all_flags_set) - : m_callback(BreakpointOptions::NullCallback), m_callback_baton_sp(), + : m_callback(BreakpointOptions::NullCallback), m_baton_is_command_baton(false), m_callback_is_synchronous(false), - m_enabled(true), m_one_shot(false), m_ignore_count(0), m_thread_spec_up(), - m_condition_text(), m_condition_text_hash(0), m_auto_continue(false), - m_set_flags(0) { + m_enabled(true), m_one_shot(false), m_ignore_count(0), + m_condition_text_hash(0), m_auto_continue(false), m_set_flags(0) { if (all_flags_set) m_set_flags.Set(~((Flags::ValueType)0)); } @@ -151,8 +150,8 @@ BreakpointOptions::BreakpointOptions(const BreakpointOptions &rhs) m_baton_is_command_baton(rhs.m_baton_is_command_baton), m_callback_is_synchronous(rhs.m_callback_is_synchronous), m_enabled(rhs.m_enabled), m_one_shot(rhs.m_one_shot), - m_ignore_count(rhs.m_ignore_count), m_thread_spec_up(), - m_auto_continue(rhs.m_auto_continue), m_set_flags(rhs.m_set_flags) { + m_ignore_count(rhs.m_ignore_count), m_auto_continue(rhs.m_auto_continue), + m_set_flags(rhs.m_set_flags) { if (rhs.m_thread_spec_up != nullptr) m_thread_spec_up = std::make_unique(*rhs.m_thread_spec_up); m_condition_text = rhs.m_condition_text; diff --git a/lldb/source/Breakpoint/BreakpointResolverAddress.cpp b/lldb/source/Breakpoint/BreakpointResolverAddress.cpp index e0f4fe400601..c173fc0c2a7a 100644 --- a/lldb/source/Breakpoint/BreakpointResolverAddress.cpp +++ b/lldb/source/Breakpoint/BreakpointResolverAddress.cpp @@ -28,8 +28,7 @@ BreakpointResolverAddress::BreakpointResolverAddress( BreakpointResolverAddress::BreakpointResolverAddress(const BreakpointSP &bkpt, const Address &addr) : BreakpointResolver(bkpt, BreakpointResolver::AddressResolver), - m_addr(addr), m_resolved_addr(LLDB_INVALID_ADDRESS), m_module_filespec() { -} + m_addr(addr), m_resolved_addr(LLDB_INVALID_ADDRESS) {} BreakpointResolver *BreakpointResolverAddress::CreateFromStructuredData( const BreakpointSP &bkpt, const StructuredData::Dictionary &options_dict, diff --git a/lldb/source/Breakpoint/BreakpointResolverName.cpp b/lldb/source/Breakpoint/BreakpointResolverName.cpp index a399c74a7556..24e36f35bef0 100644 --- a/lldb/source/Breakpoint/BreakpointResolverName.cpp +++ b/lldb/source/Breakpoint/BreakpointResolverName.cpp @@ -29,8 +29,7 @@ BreakpointResolverName::BreakpointResolverName(const BreakpointSP &bkpt, LanguageType language, Breakpoint::MatchType type, lldb::addr_t offset, bool skip_prologue) : BreakpointResolver(bkpt, BreakpointResolver::NameResolver, offset), - m_class_name(), m_regex(), m_match_type(type), m_language(language), - m_skip_prologue(skip_prologue) { + m_match_type(type), m_language(language), m_skip_prologue(skip_prologue) { if (m_match_type == Breakpoint::Regexp) { m_regex = RegularExpression(name_cstr); if (!m_regex.IsValid()) { diff --git a/lldb/source/Breakpoint/BreakpointSite.cpp b/lldb/source/Breakpoint/BreakpointSite.cpp index f0469326657c..11ebc59c7e12 100644 --- a/lldb/source/Breakpoint/BreakpointSite.cpp +++ b/lldb/source/Breakpoint/BreakpointSite.cpp @@ -25,9 +25,9 @@ BreakpointSite::BreakpointSite(BreakpointSiteList *list, m_type(eSoftware), // Process subclasses need to set this correctly using // SetType() m_saved_opcode(), m_trap_opcode(), - m_enabled(false), // Need to create it disabled, so the first enable turns - // it on. - m_owners(), m_owners_mutex() { + m_enabled(false) // Need to create it disabled, so the first enable turns + // it on. +{ m_owners.Add(owner); } diff --git a/lldb/source/Breakpoint/BreakpointSiteList.cpp b/lldb/source/Breakpoint/BreakpointSiteList.cpp index c6966145e42b..32a2f24d411a 100644 --- a/lldb/source/Breakpoint/BreakpointSiteList.cpp +++ b/lldb/source/Breakpoint/BreakpointSiteList.cpp @@ -14,7 +14,7 @@ using namespace lldb; using namespace lldb_private; -BreakpointSiteList::BreakpointSiteList() : m_mutex(), m_bp_site_list() {} +BreakpointSiteList::BreakpointSiteList() = default; BreakpointSiteList::~BreakpointSiteList() = default; diff --git a/lldb/source/Breakpoint/StoppointCallbackContext.cpp b/lldb/source/Breakpoint/StoppointCallbackContext.cpp index a561c99b1d92..926c0afe8fc1 100644 --- a/lldb/source/Breakpoint/StoppointCallbackContext.cpp +++ b/lldb/source/Breakpoint/StoppointCallbackContext.cpp @@ -10,7 +10,7 @@ using namespace lldb_private; -StoppointCallbackContext::StoppointCallbackContext() : exe_ctx_ref() {} +StoppointCallbackContext::StoppointCallbackContext() = default; StoppointCallbackContext::StoppointCallbackContext( Event *e, const ExecutionContext &exe_ctx, bool synchronously) diff --git a/lldb/source/Breakpoint/Watchpoint.cpp b/lldb/source/Breakpoint/Watchpoint.cpp index 1f0b81a758a8..933661ad7b15 100644 --- a/lldb/source/Breakpoint/Watchpoint.cpp +++ b/lldb/source/Breakpoint/Watchpoint.cpp @@ -30,8 +30,7 @@ Watchpoint::Watchpoint(Target &target, lldb::addr_t addr, uint32_t size, m_enabled(false), m_is_hardware(hardware), m_is_watch_variable(false), m_is_ephemeral(false), m_disabled_count(0), m_watch_read(0), m_watch_write(0), m_watch_was_read(0), m_watch_was_written(0), - m_ignore_count(0), m_false_alarms(0), m_decl_str(), m_watch_spec_str(), - m_type(), m_error(), m_options(), m_being_created(true) { + m_ignore_count(0), m_false_alarms(0), m_being_created(true) { if (type && type->IsValid()) m_type = *type; @@ -330,8 +329,7 @@ void Watchpoint::SendWatchpointChangedEvent(WatchpointEventData *data) { Watchpoint::WatchpointEventData::WatchpointEventData( WatchpointEventType sub_type, const WatchpointSP &new_watchpoint_sp) - : EventData(), m_watchpoint_event(sub_type), - m_new_watchpoint_sp(new_watchpoint_sp) {} + : m_watchpoint_event(sub_type), m_new_watchpoint_sp(new_watchpoint_sp) {} Watchpoint::WatchpointEventData::~WatchpointEventData() = default; diff --git a/lldb/source/Breakpoint/WatchpointList.cpp b/lldb/source/Breakpoint/WatchpointList.cpp index 100c1e51ac5a..fc0cc9126d60 100644 --- a/lldb/source/Breakpoint/WatchpointList.cpp +++ b/lldb/source/Breakpoint/WatchpointList.cpp @@ -12,7 +12,7 @@ using namespace lldb; using namespace lldb_private; -WatchpointList::WatchpointList() : m_watchpoints(), m_mutex() {} +WatchpointList::WatchpointList() = default; WatchpointList::~WatchpointList() = default; diff --git a/lldb/source/Breakpoint/WatchpointOptions.cpp b/lldb/source/Breakpoint/WatchpointOptions.cpp index a578e8744efb..c27cd62e0220 100644 --- a/lldb/source/Breakpoint/WatchpointOptions.cpp +++ b/lldb/source/Breakpoint/WatchpointOptions.cpp @@ -27,14 +27,12 @@ bool WatchpointOptions::NullCallback(void *baton, // WatchpointOptions constructor WatchpointOptions::WatchpointOptions() - : m_callback(WatchpointOptions::NullCallback), m_callback_baton_sp(), - m_thread_spec_up() {} + : m_callback(WatchpointOptions::NullCallback) {} // WatchpointOptions copy constructor WatchpointOptions::WatchpointOptions(const WatchpointOptions &rhs) : m_callback(rhs.m_callback), m_callback_baton_sp(rhs.m_callback_baton_sp), - m_callback_is_synchronous(rhs.m_callback_is_synchronous), - m_thread_spec_up() { + m_callback_is_synchronous(rhs.m_callback_is_synchronous) { if (rhs.m_thread_spec_up != nullptr) m_thread_spec_up = std::make_unique(*rhs.m_thread_spec_up); }