Skip to content

Commit 47b9aad

Browse files
[lldb] Remove redundant member initialization (NFC)
1 parent b12fd13 commit 47b9aad

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+80
-112
lines changed

lldb/include/lldb/Breakpoint/BreakpointOptions.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,10 @@ friend class Breakpoint;
4343
| eCondition | eAutoContinue)
4444
};
4545
struct CommandData {
46-
CommandData() : user_source(), script_source() {}
46+
CommandData() {}
4747

4848
CommandData(const StringList &user_source, lldb::ScriptLanguage interp)
49-
: user_source(user_source), script_source(), interpreter(interp),
50-
stop_on_error(true) {}
49+
: user_source(user_source), interpreter(interp), stop_on_error(true) {}
5150

5251
virtual ~CommandData() = default;
5352

lldb/include/lldb/Breakpoint/WatchpointOptions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ class WatchpointOptions {
166166
lldb::user_id_t watch_id);
167167

168168
struct CommandData {
169-
CommandData() : user_source(), script_source() {}
169+
CommandData() {}
170170

171171
~CommandData() = default;
172172

lldb/include/lldb/Core/Address.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ class Address {
116116
///
117117
/// Initialize with a invalid section (NULL) and an invalid offset
118118
/// (LLDB_INVALID_ADDRESS).
119-
Address() : m_section_wp() {}
119+
Address() {}
120120

121121
/// Copy constructor
122122
///

lldb/include/lldb/Core/Declaration.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ namespace lldb_private {
2424
class Declaration {
2525
public:
2626
/// Default constructor.
27-
Declaration() : m_file() {}
27+
Declaration() {}
2828

2929
/// Construct with file specification, and optional line and column.
3030
///
@@ -45,7 +45,7 @@ class Declaration {
4545

4646
/// Construct with a pointer to another Declaration object.
4747
Declaration(const Declaration *decl_ptr)
48-
: m_file(), m_line(0), m_column(LLDB_INVALID_COLUMN_NUMBER) {
48+
: m_line(0), m_column(LLDB_INVALID_COLUMN_NUMBER) {
4949
if (decl_ptr)
5050
*this = *decl_ptr;
5151
}

lldb/include/lldb/Core/Disassembler.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ class Disassembler : public std::enable_shared_from_this<Disassembler>,
465465
uint32_t line = LLDB_INVALID_LINE_NUMBER;
466466
uint32_t column = 0;
467467

468-
SourceLine() : file() {}
468+
SourceLine() {}
469469

470470
bool operator==(const SourceLine &rhs) const {
471471
return file == rhs.file && line == rhs.line && rhs.column == column;
@@ -489,7 +489,7 @@ class Disassembler : public std::enable_shared_from_this<Disassembler>,
489489
// Whether to print a blank line at the end of the source lines.
490490
bool print_source_context_end_eol = true;
491491

492-
SourceLinesToDisplay() : lines() {}
492+
SourceLinesToDisplay() {}
493493
};
494494

495495
// Get the function's declaration line number, hopefully a line number

lldb/include/lldb/Core/FormatEntity.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ class FormatEntity {
148148

149149
Entry(Type t = Type::Invalid, const char *s = nullptr,
150150
const char *f = nullptr)
151-
: string(s ? s : ""), printf_format(f ? f : ""), children(), type(t) {}
151+
: string(s ? s : ""), printf_format(f ? f : ""), type(t) {}
152152

153153
Entry(llvm::StringRef s);
154154
Entry(char ch);

lldb/include/lldb/Core/LoadedModuleInfoList.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ class LoadedModuleInfoList {
101101
lldb::addr_t m_dynamic;
102102
};
103103

104-
LoadedModuleInfoList() : m_list() {}
104+
LoadedModuleInfoList() {}
105105

106106
void add(const LoadedModuleInfo &mod) { m_list.push_back(mod); }
107107

lldb/include/lldb/Core/Module.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -905,7 +905,7 @@ class Module : public std::enable_shared_from_this<Module>,
905905
/// correctly.
906906
class LookupInfo {
907907
public:
908-
LookupInfo() : m_name(), m_lookup_name() {}
908+
LookupInfo() {}
909909

910910
LookupInfo(ConstString name, lldb::FunctionNameType name_type_mask,
911911
lldb::LanguageType language);

lldb/include/lldb/Core/ModuleSpec.h

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,29 +25,23 @@ namespace lldb_private {
2525

2626
class ModuleSpec {
2727
public:
28-
ModuleSpec()
29-
: m_file(), m_platform_file(), m_symbol_file(), m_arch(), m_uuid(),
30-
m_object_name(), m_source_mappings() {}
28+
ModuleSpec() {}
3129

3230
/// If the \c data argument is passed, its contents will be used
3331
/// as the module contents instead of trying to read them from
3432
/// \c file_spec .
3533
ModuleSpec(const FileSpec &file_spec, const UUID &uuid = UUID(),
3634
lldb::DataBufferSP data = lldb::DataBufferSP())
37-
: m_file(file_spec), m_platform_file(), m_symbol_file(), m_arch(),
38-
m_uuid(uuid), m_object_name(), m_object_offset(0), m_source_mappings(),
39-
m_data(data) {
35+
: m_file(file_spec), m_uuid(uuid), m_object_offset(0), m_data(data) {
4036
if (data)
4137
m_object_size = data->GetByteSize();
4238
else if (m_file)
4339
m_object_size = FileSystem::Instance().GetByteSize(file_spec);
4440
}
4541

4642
ModuleSpec(const FileSpec &file_spec, const ArchSpec &arch)
47-
: m_file(file_spec), m_platform_file(), m_symbol_file(), m_arch(arch),
48-
m_uuid(), m_object_name(), m_object_offset(0),
49-
m_object_size(FileSystem::Instance().GetByteSize(file_spec)),
50-
m_source_mappings() {}
43+
: m_file(file_spec), m_arch(arch), m_object_offset(0),
44+
m_object_size(FileSystem::Instance().GetByteSize(file_spec)) {}
5145

5246
FileSpec *GetFileSpecPtr() { return (m_file ? &m_file : nullptr); }
5347

@@ -279,9 +273,9 @@ class ModuleSpec {
279273

280274
class ModuleSpecList {
281275
public:
282-
ModuleSpecList() : m_specs(), m_mutex() {}
276+
ModuleSpecList() {}
283277

284-
ModuleSpecList(const ModuleSpecList &rhs) : m_specs(), m_mutex() {
278+
ModuleSpecList(const ModuleSpecList &rhs) {
285279
std::lock_guard<std::recursive_mutex> lhs_guard(m_mutex);
286280
std::lock_guard<std::recursive_mutex> rhs_guard(rhs.m_mutex);
287281
m_specs = rhs.m_specs;

lldb/include/lldb/Core/StructuredDataImpl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ namespace lldb_private {
2525

2626
class StructuredDataImpl {
2727
public:
28-
StructuredDataImpl() : m_plugin_wp(), m_data_sp() {}
28+
StructuredDataImpl() {}
2929

3030
StructuredDataImpl(const StructuredDataImpl &rhs) = default;
3131

lldb/include/lldb/Core/ThreadSafeValue.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ namespace lldb_private {
1818
template <class T> class ThreadSafeValue {
1919
public:
2020
ThreadSafeValue() = default;
21-
ThreadSafeValue(const T &value) : m_value(value), m_mutex() {}
21+
ThreadSafeValue(const T &value) : m_value(value) {}
2222

2323
~ThreadSafeValue() = default;
2424

lldb/include/lldb/Core/Value.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ class Value {
156156

157157
class ValueList {
158158
public:
159-
ValueList() : m_values() {}
159+
ValueList() {}
160160

161161
ValueList(const ValueList &rhs);
162162

lldb/include/lldb/Core/ValueObject.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -795,7 +795,7 @@ class ValueObject {
795795

796796
class ChildrenManager {
797797
public:
798-
ChildrenManager() : m_mutex(), m_children() {}
798+
ChildrenManager() {}
799799

800800
bool HasChildAtIndex(size_t idx) {
801801
std::lock_guard<std::recursive_mutex> guard(m_mutex);

lldb/include/lldb/DataFormatters/FormatClasses.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,23 +105,23 @@ class FormattersMatchData {
105105

106106
class TypeNameSpecifierImpl {
107107
public:
108-
TypeNameSpecifierImpl() : m_type() {}
108+
TypeNameSpecifierImpl() {}
109109

110110
TypeNameSpecifierImpl(llvm::StringRef name, bool is_regex)
111-
: m_is_regex(is_regex), m_type() {
111+
: m_is_regex(is_regex) {
112112
m_type.m_type_name = std::string(name);
113113
}
114114

115115
// if constructing with a given type, is_regex cannot be true since we are
116116
// giving an exact type to match
117-
TypeNameSpecifierImpl(lldb::TypeSP type) : m_is_regex(false), m_type() {
117+
TypeNameSpecifierImpl(lldb::TypeSP type) : m_is_regex(false) {
118118
if (type) {
119119
m_type.m_type_name = std::string(type->GetName().GetStringRef());
120120
m_type.m_compiler_type = type->GetForwardCompilerType();
121121
}
122122
}
123123

124-
TypeNameSpecifierImpl(CompilerType type) : m_is_regex(false), m_type() {
124+
TypeNameSpecifierImpl(CompilerType type) : m_is_regex(false) {
125125
if (type.IsValid()) {
126126
m_type.m_type_name.assign(type.GetTypeName().GetCString());
127127
m_type.m_compiler_type = type;

lldb/include/lldb/DataFormatters/TypeSynthetic.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -279,11 +279,11 @@ class TypeFilterImpl : public SyntheticChildren {
279279

280280
public:
281281
TypeFilterImpl(const SyntheticChildren::Flags &flags)
282-
: SyntheticChildren(flags), m_expression_paths() {}
282+
: SyntheticChildren(flags) {}
283283

284284
TypeFilterImpl(const SyntheticChildren::Flags &flags,
285285
const std::initializer_list<const char *> items)
286-
: SyntheticChildren(flags), m_expression_paths() {
286+
: SyntheticChildren(flags) {
287287
for (auto path : items)
288288
AddExpressionPath(path);
289289
}
@@ -391,7 +391,7 @@ class ScriptedSyntheticChildren : public SyntheticChildren {
391391
public:
392392
ScriptedSyntheticChildren(const SyntheticChildren::Flags &flags,
393393
const char *pclass, const char *pcode = nullptr)
394-
: SyntheticChildren(flags), m_python_class(), m_python_code() {
394+
: SyntheticChildren(flags) {
395395
if (pclass)
396396
m_python_class = pclass;
397397
if (pcode)

lldb/include/lldb/Expression/IRExecutionUnit.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -347,10 +347,9 @@ class IRExecutionUnit : public std::enable_shared_from_this<IRExecutionUnit>,
347347
AllocationRecord(uintptr_t host_address, uint32_t permissions,
348348
lldb::SectionType sect_type, size_t size,
349349
unsigned alignment, unsigned section_id, const char *name)
350-
: m_name(), m_process_address(LLDB_INVALID_ADDRESS),
351-
m_host_address(host_address), m_permissions(permissions),
352-
m_sect_type(sect_type), m_size(size), m_alignment(alignment),
353-
m_section_id(section_id) {
350+
: m_process_address(LLDB_INVALID_ADDRESS), m_host_address(host_address),
351+
m_permissions(permissions), m_sect_type(sect_type), m_size(size),
352+
m_alignment(alignment), m_section_id(section_id) {
354353
if (name && name[0])
355354
m_name = name;
356355
}

lldb/include/lldb/Host/Debug.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,13 @@ struct ResumeAction {
3232
// send a signal to the thread when the action is run or step.
3333
class ResumeActionList {
3434
public:
35-
ResumeActionList() : m_actions(), m_signal_handled() {}
35+
ResumeActionList() {}
3636

37-
ResumeActionList(lldb::StateType default_action, int signal)
38-
: m_actions(), m_signal_handled() {
37+
ResumeActionList(lldb::StateType default_action, int signal) {
3938
SetDefaultThreadActionIfNeeded(default_action, signal);
4039
}
4140

42-
ResumeActionList(const ResumeAction *actions, size_t num_actions)
43-
: m_actions(), m_signal_handled() {
41+
ResumeActionList(const ResumeAction *actions, size_t num_actions) {
4442
if (actions && num_actions) {
4543
m_actions.assign(actions, actions + num_actions);
4644
m_signal_handled.assign(num_actions, false);

lldb/include/lldb/Host/FileSystem.h

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,13 @@ class FileSystem {
3131
static const char *DEV_NULL;
3232
static const char *PATH_CONVERSION_ERROR;
3333

34-
FileSystem()
35-
: m_fs(llvm::vfs::getRealFileSystem()), m_collector(nullptr),
36-
m_home_directory() {}
34+
FileSystem() : m_fs(llvm::vfs::getRealFileSystem()), m_collector(nullptr) {}
3735
FileSystem(std::shared_ptr<llvm::FileCollectorBase> collector)
3836
: m_fs(llvm::vfs::getRealFileSystem()), m_collector(std::move(collector)),
39-
m_home_directory(), m_mapped(false) {}
37+
m_mapped(false) {}
4038
FileSystem(llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> fs,
4139
bool mapped = false)
42-
: m_fs(std::move(fs)), m_collector(nullptr), m_home_directory(),
43-
m_mapped(mapped) {}
40+
: m_fs(std::move(fs)), m_collector(nullptr), m_mapped(mapped) {}
4441

4542
FileSystem(const FileSystem &fs) = delete;
4643
FileSystem &operator=(const FileSystem &fs) = delete;

lldb/include/lldb/Interpreter/OptionValueArray.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ namespace lldb_private {
1818
class OptionValueArray : public Cloneable<OptionValueArray, OptionValue> {
1919
public:
2020
OptionValueArray(uint32_t type_mask = UINT32_MAX, bool raw_value_dump = false)
21-
: m_type_mask(type_mask), m_values(), m_raw_value_dump(raw_value_dump) {}
21+
: m_type_mask(type_mask), m_raw_value_dump(raw_value_dump) {}
2222

2323
~OptionValueArray() override = default;
2424

lldb/include/lldb/Symbol/CompactUnwindInfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ class CompactUnwindInfo {
8686
// valid for (start of the function)
8787
uint32_t valid_range_offset_end =
8888
0; // the offset of the start of the next function
89-
FunctionInfo() : lsda_address(), personality_ptr_address() {}
89+
FunctionInfo() {}
9090
};
9191

9292
struct UnwindHeader {

lldb/include/lldb/Symbol/DWARFCallFrameInfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ class DWARFCallFrameInfo {
107107
: cie_offset(offset), version(-1), code_align(0), data_align(0),
108108
return_addr_reg_num(LLDB_INVALID_REGNUM), inst_offset(0),
109109
inst_length(0), ptr_encoding(0), lsda_addr_encoding(DW_EH_PE_omit),
110-
personality_loc(LLDB_INVALID_ADDRESS), initial_row() {}
110+
personality_loc(LLDB_INVALID_ADDRESS) {}
111111
};
112112

113113
typedef std::shared_ptr<CIE> CIESP;

lldb/include/lldb/Symbol/ObjectContainer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class ObjectContainer : public PluginInterface, public ModuleChild {
3939
lldb::DataBufferSP &data_sp, lldb::offset_t data_offset)
4040
: ModuleChild(module_sp),
4141
m_file(), // This file can be different than the module's file spec
42-
m_offset(file_offset), m_length(length), m_data() {
42+
m_offset(file_offset), m_length(length) {
4343
if (file)
4444
m_file = *file;
4545
if (data_sp)

lldb/include/lldb/Symbol/Type.h

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ class TypeImpl {
314314

315315
class TypeListImpl {
316316
public:
317-
TypeListImpl() : m_content() {}
317+
TypeListImpl() {}
318318

319319
void Append(const lldb::TypeImplSP &type) { m_content.push_back(type); }
320320

@@ -345,10 +345,7 @@ class TypeListImpl {
345345

346346
class TypeMemberImpl {
347347
public:
348-
TypeMemberImpl()
349-
: m_type_impl_sp(), m_name()
350-
351-
{}
348+
TypeMemberImpl() {}
352349

353350
TypeMemberImpl(const lldb::TypeImplSP &type_impl_sp, uint64_t bit_offset,
354351
ConstString name, uint32_t bitfield_bit_size = 0,
@@ -357,7 +354,7 @@ class TypeMemberImpl {
357354
m_bitfield_bit_size(bitfield_bit_size), m_is_bitfield(is_bitfield) {}
358355

359356
TypeMemberImpl(const lldb::TypeImplSP &type_impl_sp, uint64_t bit_offset)
360-
: m_type_impl_sp(type_impl_sp), m_bit_offset(bit_offset), m_name(),
357+
: m_type_impl_sp(type_impl_sp), m_bit_offset(bit_offset),
361358
m_bitfield_bit_size(0), m_is_bitfield(false) {
362359
if (m_type_impl_sp)
363360
m_name = m_type_impl_sp->GetName();
@@ -440,7 +437,7 @@ class TypeAndOrName {
440437

441438
class TypeMemberFunctionImpl {
442439
public:
443-
TypeMemberFunctionImpl() : m_type(), m_decl(), m_name() {}
440+
TypeMemberFunctionImpl() {}
444441

445442
TypeMemberFunctionImpl(const CompilerType &type, const CompilerDecl &decl,
446443
const std::string &name,
@@ -477,7 +474,7 @@ class TypeMemberFunctionImpl {
477474

478475
class TypeEnumMemberImpl {
479476
public:
480-
TypeEnumMemberImpl() : m_integer_type_sp(), m_name("<invalid>"), m_value() {}
477+
TypeEnumMemberImpl() : m_name("<invalid>") {}
481478

482479
TypeEnumMemberImpl(const lldb::TypeImplSP &integer_type_sp, ConstString name,
483480
const llvm::APSInt &value);
@@ -505,7 +502,7 @@ class TypeEnumMemberImpl {
505502

506503
class TypeEnumMemberListImpl {
507504
public:
508-
TypeEnumMemberListImpl() : m_content() {}
505+
TypeEnumMemberListImpl() {}
509506

510507
void Append(const lldb::TypeEnumMemberImplSP &type) {
511508
m_content.push_back(type);

lldb/include/lldb/Symbol/UnwindPlan.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -395,12 +395,10 @@ class UnwindPlan {
395395
typedef std::shared_ptr<Row> RowSP;
396396

397397
UnwindPlan(lldb::RegisterKind reg_kind)
398-
: m_row_list(), m_plan_valid_address_range(), m_register_kind(reg_kind),
399-
m_return_addr_register(LLDB_INVALID_REGNUM), m_source_name(),
398+
: m_register_kind(reg_kind), m_return_addr_register(LLDB_INVALID_REGNUM),
400399
m_plan_is_sourced_from_compiler(eLazyBoolCalculate),
401400
m_plan_is_valid_at_all_instruction_locations(eLazyBoolCalculate),
402-
m_plan_is_for_signal_trap(eLazyBoolCalculate),
403-
m_lsda_address(), m_personality_func_addr() {}
401+
m_plan_is_for_signal_trap(eLazyBoolCalculate) {}
404402

405403
// Performs a deep copy of the plan, including all the rows (expensive).
406404
UnwindPlan(const UnwindPlan &rhs)

lldb/include/lldb/Target/InstrumentationRuntime.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ class InstrumentationRuntime
4242

4343
protected:
4444
InstrumentationRuntime(const lldb::ProcessSP &process_sp)
45-
: m_process_wp(), m_runtime_module(), m_breakpoint_id(0),
46-
m_is_active(false) {
45+
: m_breakpoint_id(0), m_is_active(false) {
4746
if (process_sp)
4847
m_process_wp = process_sp;
4948
}

0 commit comments

Comments
 (0)