[Lldb-commits] [lldb] ee4b6cf - [Breakpoint] Remove redundant member initialization (NFC)
Kazu Hirata via lldb-commits
lldb-commits at lists.llvm.org
Sun Feb 6 10:55:05 PST 2022
Author: Kazu Hirata
Date: 2022-02-06T10:54:46-08:00
New Revision: ee4b6cf5387b1b9eef7f21ae93a868b1aded4b08
URL: https://github.com/llvm/llvm-project/commit/ee4b6cf5387b1b9eef7f21ae93a868b1aded4b08
DIFF: https://github.com/llvm/llvm-project/commit/ee4b6cf5387b1b9eef7f21ae93a868b1aded4b08.diff
LOG: [Breakpoint] Remove redundant member initialization (NFC)
Identified with readability-redundant-member-init.
Added:
Modified:
lldb/source/Breakpoint/Breakpoint.cpp
lldb/source/Breakpoint/BreakpointList.cpp
lldb/source/Breakpoint/BreakpointLocation.cpp
lldb/source/Breakpoint/BreakpointLocationCollection.cpp
lldb/source/Breakpoint/BreakpointLocationList.cpp
lldb/source/Breakpoint/BreakpointOptions.cpp
lldb/source/Breakpoint/BreakpointResolverAddress.cpp
lldb/source/Breakpoint/BreakpointResolverName.cpp
lldb/source/Breakpoint/BreakpointSite.cpp
lldb/source/Breakpoint/BreakpointSiteList.cpp
lldb/source/Breakpoint/StoppointCallbackContext.cpp
lldb/source/Breakpoint/Watchpoint.cpp
lldb/source/Breakpoint/WatchpointList.cpp
lldb/source/Breakpoint/WatchpointOptions.cpp
Removed:
################################################################################
diff --git a/lldb/source/Breakpoint/Breakpoint.cpp b/lldb/source/Breakpoint/Breakpoint.cpp
index 8cbc79c243700..050457986eba6 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 ca181ee306a4e..f4d4b2edbf08b 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 0b73d7cc890dd..0ee8bcf491ead 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 6c55629b5aadb..7efb2870e87e9 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 6d271864c445a..46f66276d28d9 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 86a7c483df83e..3dcb1904c8f8f 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<ThreadSpec>(*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 e0f4fe4006010..c173fc0c2a7a6 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 a399c74a75563..24e36f35bef02 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 f0469326657cd..11ebc59c7e124 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 c6966145e42be..32a2f24d411a1 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 a561c99b1d924..926c0afe8fc15 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 1f0b81a758a83..933661ad7b156 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 100c1e51ac5a2..fc0cc9126d602 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 a578e8744efbd..c27cd62e02206 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<ThreadSpec>(*rhs.m_thread_spec_up);
}
More information about the lldb-commits
mailing list