Skip to content

Commit

Permalink
[API] Remove redundant member initialization (NFC)
Browse files Browse the repository at this point in the history
Identified with readability-redundant-member-init.
  • Loading branch information
kazutakahirata committed Jan 3, 2022
1 parent 1461bd1 commit a3436f7
Show file tree
Hide file tree
Showing 44 changed files with 78 additions and 124 deletions.
2 changes: 1 addition & 1 deletion lldb/source/API/SBBreakpoint.cpp
Expand Up @@ -821,7 +821,7 @@ BreakpointSP SBBreakpoint::GetSP() const { return m_opaque_wp.lock(); }
// This is simple collection of breakpoint id's and their target.
class SBBreakpointListImpl {
public:
SBBreakpointListImpl(lldb::TargetSP target_sp) : m_target_wp() {
SBBreakpointListImpl(lldb::TargetSP target_sp) {
if (target_sp && target_sp->IsValid())
m_target_wp = target_sp;
}
Expand Down
2 changes: 1 addition & 1 deletion lldb/source/API/SBBroadcaster.cpp
Expand Up @@ -16,7 +16,7 @@
using namespace lldb;
using namespace lldb_private;

SBBroadcaster::SBBroadcaster() : m_opaque_sp() {
SBBroadcaster::SBBroadcaster() {
LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBBroadcaster);
}

Expand Down
6 changes: 2 additions & 4 deletions lldb/source/API/SBCommandInterpreterRunOptions.cpp
Expand Up @@ -25,8 +25,7 @@ SBCommandInterpreterRunOptions::SBCommandInterpreterRunOptions() {
}

SBCommandInterpreterRunOptions::SBCommandInterpreterRunOptions(
const SBCommandInterpreterRunOptions &rhs)
: m_opaque_up() {
const SBCommandInterpreterRunOptions &rhs) {
LLDB_RECORD_CONSTRUCTOR(SBCommandInterpreterRunOptions,
(const lldb::SBCommandInterpreterRunOptions &), rhs);

Expand Down Expand Up @@ -215,8 +214,7 @@ SBCommandInterpreterRunResult::SBCommandInterpreterRunResult(
}

SBCommandInterpreterRunResult::SBCommandInterpreterRunResult(
const CommandInterpreterRunResult &rhs)
: m_opaque_up() {
const CommandInterpreterRunResult &rhs) {
m_opaque_up = std::make_unique<CommandInterpreterRunResult>(rhs);
}

Expand Down
3 changes: 1 addition & 2 deletions lldb/source/API/SBCommandReturnObject.cpp
Expand Up @@ -55,8 +55,7 @@ SBCommandReturnObject::SBCommandReturnObject(CommandReturnObject &ref)
(lldb_private::CommandReturnObject &), ref);
}

SBCommandReturnObject::SBCommandReturnObject(const SBCommandReturnObject &rhs)
: m_opaque_up() {
SBCommandReturnObject::SBCommandReturnObject(const SBCommandReturnObject &rhs) {
LLDB_RECORD_CONSTRUCTOR(SBCommandReturnObject,
(const lldb::SBCommandReturnObject &), rhs);

Expand Down
7 changes: 3 additions & 4 deletions lldb/source/API/SBDeclaration.cpp
Expand Up @@ -19,18 +19,17 @@
using namespace lldb;
using namespace lldb_private;

SBDeclaration::SBDeclaration() : m_opaque_up() {
SBDeclaration::SBDeclaration() {
LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBDeclaration);
}

SBDeclaration::SBDeclaration(const SBDeclaration &rhs) : m_opaque_up() {
SBDeclaration::SBDeclaration(const SBDeclaration &rhs) {
LLDB_RECORD_CONSTRUCTOR(SBDeclaration, (const lldb::SBDeclaration &), rhs);

m_opaque_up = clone(rhs.m_opaque_up);
}

SBDeclaration::SBDeclaration(const lldb_private::Declaration *lldb_object_ptr)
: m_opaque_up() {
SBDeclaration::SBDeclaration(const lldb_private::Declaration *lldb_object_ptr) {
if (lldb_object_ptr)
m_opaque_up = std::make_unique<Declaration>(*lldb_object_ptr);
}
Expand Down
4 changes: 2 additions & 2 deletions lldb/source/API/SBError.cpp
Expand Up @@ -17,9 +17,9 @@
using namespace lldb;
using namespace lldb_private;

SBError::SBError() : m_opaque_up() { LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBError); }
SBError::SBError() { LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBError); }

SBError::SBError(const SBError &rhs) : m_opaque_up() {
SBError::SBError(const SBError &rhs) {
LLDB_RECORD_CONSTRUCTOR(SBError, (const lldb::SBError &), rhs);

m_opaque_up = clone(rhs.m_opaque_up);
Expand Down
4 changes: 2 additions & 2 deletions lldb/source/API/SBEvent.cpp
Expand Up @@ -22,7 +22,7 @@
using namespace lldb;
using namespace lldb_private;

SBEvent::SBEvent() : m_event_sp() { LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBEvent); }
SBEvent::SBEvent() { LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBEvent); }

SBEvent::SBEvent(uint32_t event_type, const char *cstr, uint32_t cstr_len)
: m_event_sp(new Event(event_type, new EventDataBytes(cstr, cstr_len))),
Expand All @@ -36,7 +36,7 @@ SBEvent::SBEvent(EventSP &event_sp)
LLDB_RECORD_CONSTRUCTOR(SBEvent, (lldb::EventSP &), event_sp);
}

SBEvent::SBEvent(Event *event_ptr) : m_event_sp(), m_opaque_ptr(event_ptr) {
SBEvent::SBEvent(Event *event_ptr) : m_opaque_ptr(event_ptr) {
LLDB_RECORD_CONSTRUCTOR(SBEvent, (lldb_private::Event *), event_ptr);
}

Expand Down
2 changes: 1 addition & 1 deletion lldb/source/API/SBExecutionContext.cpp
Expand Up @@ -19,7 +19,7 @@
using namespace lldb;
using namespace lldb_private;

SBExecutionContext::SBExecutionContext() : m_exe_ctx_sp() {
SBExecutionContext::SBExecutionContext() {
LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBExecutionContext);
}

Expand Down
3 changes: 1 addition & 2 deletions lldb/source/API/SBExpressionOptions.cpp
Expand Up @@ -20,8 +20,7 @@ SBExpressionOptions::SBExpressionOptions()
LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBExpressionOptions);
}

SBExpressionOptions::SBExpressionOptions(const SBExpressionOptions &rhs)
: m_opaque_up() {
SBExpressionOptions::SBExpressionOptions(const SBExpressionOptions &rhs) {
LLDB_RECORD_CONSTRUCTOR(SBExpressionOptions,
(const lldb::SBExpressionOptions &), rhs);

Expand Down
2 changes: 1 addition & 1 deletion lldb/source/API/SBFileSpec.cpp
Expand Up @@ -27,7 +27,7 @@ SBFileSpec::SBFileSpec() : m_opaque_up(new lldb_private::FileSpec()) {
LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBFileSpec);
}

SBFileSpec::SBFileSpec(const SBFileSpec &rhs) : m_opaque_up() {
SBFileSpec::SBFileSpec(const SBFileSpec &rhs) {
LLDB_RECORD_CONSTRUCTOR(SBFileSpec, (const lldb::SBFileSpec &), rhs);

m_opaque_up = clone(rhs.m_opaque_up);
Expand Down
3 changes: 1 addition & 2 deletions lldb/source/API/SBFileSpecList.cpp
Expand Up @@ -25,10 +25,9 @@ SBFileSpecList::SBFileSpecList() : m_opaque_up(new FileSpecList()) {
LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBFileSpecList);
}

SBFileSpecList::SBFileSpecList(const SBFileSpecList &rhs) : m_opaque_up() {
SBFileSpecList::SBFileSpecList(const SBFileSpecList &rhs) {
LLDB_RECORD_CONSTRUCTOR(SBFileSpecList, (const lldb::SBFileSpecList &), rhs);


m_opaque_up = clone(rhs.m_opaque_up);
}

Expand Down
2 changes: 1 addition & 1 deletion lldb/source/API/SBFrame.cpp
Expand Up @@ -64,7 +64,7 @@ SBFrame::SBFrame(const StackFrameSP &lldb_object_sp)
lldb_object_sp);
}

SBFrame::SBFrame(const SBFrame &rhs) : m_opaque_sp() {
SBFrame::SBFrame(const SBFrame &rhs) {
LLDB_RECORD_CONSTRUCTOR(SBFrame, (const lldb::SBFrame &), rhs);

m_opaque_sp = clone(rhs.m_opaque_sp);
Expand Down
2 changes: 1 addition & 1 deletion lldb/source/API/SBInstruction.cpp
Expand Up @@ -66,7 +66,7 @@ class InstructionImpl {
using namespace lldb;
using namespace lldb_private;

SBInstruction::SBInstruction() : m_opaque_sp() {
SBInstruction::SBInstruction() {
LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBInstruction);
}

Expand Down
2 changes: 1 addition & 1 deletion lldb/source/API/SBInstructionList.cpp
Expand Up @@ -21,7 +21,7 @@
using namespace lldb;
using namespace lldb_private;

SBInstructionList::SBInstructionList() : m_opaque_sp() {
SBInstructionList::SBInstructionList() {
LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBInstructionList);
}

Expand Down
3 changes: 1 addition & 2 deletions lldb/source/API/SBLaunchInfo.cpp
Expand Up @@ -23,8 +23,7 @@ using namespace lldb_private;

class lldb_private::SBLaunchInfoImpl : public ProcessLaunchInfo {
public:
SBLaunchInfoImpl()
: ProcessLaunchInfo(), m_envp(GetEnvironment().getEnvp()) {}
SBLaunchInfoImpl() : m_envp(GetEnvironment().getEnvp()) {}

const char *const *GetEnvp() const { return m_envp; }
void RegenerateEnvp() { m_envp = GetEnvironment().getEnvp(); }
Expand Down
9 changes: 3 additions & 6 deletions lldb/source/API/SBLineEntry.cpp
Expand Up @@ -19,18 +19,15 @@
using namespace lldb;
using namespace lldb_private;

SBLineEntry::SBLineEntry() : m_opaque_up() {
LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBLineEntry);
}
SBLineEntry::SBLineEntry() { LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBLineEntry); }

SBLineEntry::SBLineEntry(const SBLineEntry &rhs) : m_opaque_up() {
SBLineEntry::SBLineEntry(const SBLineEntry &rhs) {
LLDB_RECORD_CONSTRUCTOR(SBLineEntry, (const lldb::SBLineEntry &), rhs);

m_opaque_up = clone(rhs.m_opaque_up);
}

SBLineEntry::SBLineEntry(const lldb_private::LineEntry *lldb_object_ptr)
: m_opaque_up() {
SBLineEntry::SBLineEntry(const lldb_private::LineEntry *lldb_object_ptr) {
if (lldb_object_ptr)
m_opaque_up = std::make_unique<LineEntry>(*lldb_object_ptr);
}
Expand Down
4 changes: 1 addition & 3 deletions lldb/source/API/SBListener.cpp
Expand Up @@ -20,9 +20,7 @@
using namespace lldb;
using namespace lldb_private;

SBListener::SBListener() : m_opaque_sp() {
LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBListener);
}
SBListener::SBListener() { LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBListener); }

SBListener::SBListener(const char *name)
: m_opaque_sp(Listener::MakeListener(name)), m_unused_ptr(nullptr) {
Expand Down
3 changes: 1 addition & 2 deletions lldb/source/API/SBMemoryRegionInfo.cpp
Expand Up @@ -46,8 +46,7 @@ SBMemoryRegionInfo::SBMemoryRegionInfo(const MemoryRegionInfo *lldb_object_ptr)
ref() = *lldb_object_ptr;
}

SBMemoryRegionInfo::SBMemoryRegionInfo(const SBMemoryRegionInfo &rhs)
: m_opaque_up() {
SBMemoryRegionInfo::SBMemoryRegionInfo(const SBMemoryRegionInfo &rhs) {
LLDB_RECORD_CONSTRUCTOR(SBMemoryRegionInfo,
(const lldb::SBMemoryRegionInfo &), rhs);
m_opaque_up = clone(rhs.m_opaque_up);
Expand Down
9 changes: 3 additions & 6 deletions lldb/source/API/SBModule.cpp
Expand Up @@ -29,13 +29,11 @@
using namespace lldb;
using namespace lldb_private;

SBModule::SBModule() : m_opaque_sp() {
LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBModule);
}
SBModule::SBModule() { LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBModule); }

SBModule::SBModule(const lldb::ModuleSP &module_sp) : m_opaque_sp(module_sp) {}

SBModule::SBModule(const SBModuleSpec &module_spec) : m_opaque_sp() {
SBModule::SBModule(const SBModuleSpec &module_spec) {
LLDB_RECORD_CONSTRUCTOR(SBModule, (const lldb::SBModuleSpec &), module_spec);

ModuleSP module_sp;
Expand All @@ -49,8 +47,7 @@ SBModule::SBModule(const SBModule &rhs) : m_opaque_sp(rhs.m_opaque_sp) {
LLDB_RECORD_CONSTRUCTOR(SBModule, (const lldb::SBModule &), rhs);
}

SBModule::SBModule(lldb::SBProcess &process, lldb::addr_t header_addr)
: m_opaque_sp() {
SBModule::SBModule(lldb::SBProcess &process, lldb::addr_t header_addr) {
LLDB_RECORD_CONSTRUCTOR(SBModule, (lldb::SBProcess &, lldb::addr_t), process,
header_addr);

Expand Down
2 changes: 1 addition & 1 deletion lldb/source/API/SBModuleSpec.cpp
Expand Up @@ -23,7 +23,7 @@ SBModuleSpec::SBModuleSpec() : m_opaque_up(new lldb_private::ModuleSpec()) {
LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBModuleSpec);
}

SBModuleSpec::SBModuleSpec(const SBModuleSpec &rhs) : m_opaque_up() {
SBModuleSpec::SBModuleSpec(const SBModuleSpec &rhs) {
LLDB_RECORD_CONSTRUCTOR(SBModuleSpec, (const lldb::SBModuleSpec &), rhs);

m_opaque_up = clone(rhs.m_opaque_up);
Expand Down
16 changes: 5 additions & 11 deletions lldb/source/API/SBPlatform.cpp
Expand Up @@ -30,10 +30,7 @@ using namespace lldb_private;

// PlatformConnectOptions
struct PlatformConnectOptions {
PlatformConnectOptions(const char *url = nullptr)
: m_url(), m_rsync_options(), m_rsync_remote_path_prefix(),

m_local_cache_directory() {
PlatformConnectOptions(const char *url = nullptr) {
if (url && url[0])
m_url = url;
}
Expand All @@ -52,16 +49,15 @@ struct PlatformConnectOptions {
struct PlatformShellCommand {
PlatformShellCommand(llvm::StringRef shell_interpreter,
llvm::StringRef shell_command)
: m_command(), m_working_dir(), m_status(0), m_signo(0) {
: m_status(0), m_signo(0) {
if (!shell_interpreter.empty())
m_shell = shell_interpreter.str();

if (!m_shell.empty() && !shell_command.empty())
m_command = shell_command.str();
}

PlatformShellCommand(llvm::StringRef shell_command = llvm::StringRef())
: m_shell(), m_command(), m_working_dir() {
PlatformShellCommand(llvm::StringRef shell_command = llvm::StringRef()) {
if (!shell_command.empty())
m_command = shell_command.str();
}
Expand Down Expand Up @@ -313,11 +309,9 @@ const char *SBPlatformShellCommand::GetOutput() {
}

// SBPlatform
SBPlatform::SBPlatform() : m_opaque_sp() {
LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBPlatform);
}
SBPlatform::SBPlatform() { LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBPlatform); }

SBPlatform::SBPlatform(const char *platform_name) : m_opaque_sp() {
SBPlatform::SBPlatform(const char *platform_name) {
LLDB_RECORD_CONSTRUCTOR(SBPlatform, (const char *), platform_name);

Status error;
Expand Down
4 changes: 1 addition & 3 deletions lldb/source/API/SBProcess.cpp
Expand Up @@ -49,9 +49,7 @@
using namespace lldb;
using namespace lldb_private;

SBProcess::SBProcess() : m_opaque_wp() {
LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBProcess);
}
SBProcess::SBProcess() { LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBProcess); }

// SBProcess constructor

Expand Down
4 changes: 2 additions & 2 deletions lldb/source/API/SBProcessInfo.cpp
Expand Up @@ -15,11 +15,11 @@
using namespace lldb;
using namespace lldb_private;

SBProcessInfo::SBProcessInfo() : m_opaque_up() {
SBProcessInfo::SBProcessInfo() {
LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBProcessInfo);
}

SBProcessInfo::SBProcessInfo(const SBProcessInfo &rhs) : m_opaque_up() {
SBProcessInfo::SBProcessInfo(const SBProcessInfo &rhs) {
LLDB_RECORD_CONSTRUCTOR(SBProcessInfo, (const lldb::SBProcessInfo &), rhs);

m_opaque_up = clone(rhs.m_opaque_up);
Expand Down
5 changes: 2 additions & 3 deletions lldb/source/API/SBQueue.cpp
Expand Up @@ -27,11 +27,10 @@ namespace lldb_private {

class QueueImpl {
public:
QueueImpl() : m_queue_wp(), m_threads(), m_pending_items() {}
QueueImpl() {}

QueueImpl(const lldb::QueueSP &queue_sp)
: m_queue_wp(), m_threads(), m_thread_list_fetched(false),
m_pending_items(), m_pending_items_fetched(false) {
: m_thread_list_fetched(false), m_pending_items_fetched(false) {
m_queue_wp = queue_sp;
}

Expand Down
4 changes: 1 addition & 3 deletions lldb/source/API/SBQueueItem.cpp
Expand Up @@ -21,9 +21,7 @@ using namespace lldb;
using namespace lldb_private;

// Constructors
SBQueueItem::SBQueueItem() : m_queue_item_sp() {
LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBQueueItem);
}
SBQueueItem::SBQueueItem() { LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBQueueItem); }

SBQueueItem::SBQueueItem(const QueueItemSP &queue_item_sp)
: m_queue_item_sp(queue_item_sp) {
Expand Down
2 changes: 1 addition & 1 deletion lldb/source/API/SBReproducerPrivate.h
Expand Up @@ -59,7 +59,7 @@ class SBProvider : public Provider<SBProvider> {
class ReplayData {
public:
ReplayData(std::unique_ptr<llvm::MemoryBuffer> memory_buffer)
: m_memory_buffer(std::move(memory_buffer)), m_registry(),
: m_memory_buffer(std::move(memory_buffer)),
m_deserializer(m_memory_buffer->getBuffer()) {}
Deserializer &GetDeserializer() { return m_deserializer; }
Registry &GetRegistry() { return m_registry; }
Expand Down
11 changes: 4 additions & 7 deletions lldb/source/API/SBSection.cpp
Expand Up @@ -20,18 +20,15 @@
using namespace lldb;
using namespace lldb_private;

SBSection::SBSection() : m_opaque_wp() {
LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBSection);
}
SBSection::SBSection() { LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBSection); }

SBSection::SBSection(const SBSection &rhs) : m_opaque_wp(rhs.m_opaque_wp) {
LLDB_RECORD_CONSTRUCTOR(SBSection, (const lldb::SBSection &), rhs);
}

SBSection::SBSection(const lldb::SectionSP &section_sp)
: m_opaque_wp() // Don't init with section_sp otherwise this will throw if
// section_sp doesn't contain a valid Section *
{
SBSection::SBSection(const lldb::SectionSP &section_sp) {
// Don't init with section_sp otherwise this will throw if
// section_sp doesn't contain a valid Section *
if (section_sp)
m_opaque_wp = section_sp;
}
Expand Down
5 changes: 2 additions & 3 deletions lldb/source/API/SBSourceManager.cpp
Expand Up @@ -24,10 +24,9 @@ namespace lldb_private {
class SourceManagerImpl {
public:
SourceManagerImpl(const lldb::DebuggerSP &debugger_sp)
: m_debugger_wp(debugger_sp), m_target_wp() {}
: m_debugger_wp(debugger_sp) {}

SourceManagerImpl(const lldb::TargetSP &target_sp)
: m_debugger_wp(), m_target_wp(target_sp) {}
SourceManagerImpl(const lldb::TargetSP &target_sp) : m_target_wp(target_sp) {}

SourceManagerImpl(const SourceManagerImpl &rhs) {
if (&rhs == this)
Expand Down

0 comments on commit a3436f7

Please sign in to comment.