[lldb/Interpreter][NFC] Replace default constructors/destructors bodies with "=default"

This commit is contained in:
Tatyana Krasnukha 2021-02-18 12:32:22 +03:00
parent 9182117861
commit 54d03a4985
53 changed files with 55 additions and 109 deletions

View File

@ -20,9 +20,9 @@ namespace lldb_private {
class CommandHistory {
public:
CommandHistory();
CommandHistory() = default;
~CommandHistory();
~CommandHistory() = default;
size_t GetSize() const;

View File

@ -113,7 +113,7 @@ public:
llvm::StringRef help = "", llvm::StringRef syntax = "",
uint32_t flags = 0);
virtual ~CommandObject();
virtual ~CommandObject() = default;
static const char *
GetArgumentTypeAsCString(const lldb::CommandArgumentType arg_type);

View File

@ -26,7 +26,7 @@ class CommandReturnObject {
public:
CommandReturnObject(bool colors);
~CommandReturnObject();
~CommandReturnObject() = default;
llvm::StringRef GetOutputData() {
lldb::StreamSP stream_sp(m_out_stream.GetStreamAtIndex(eStreamStringIndex));

View File

@ -18,9 +18,9 @@ namespace lldb_private {
class OptionGroupArchitecture : public OptionGroup {
public:
OptionGroupArchitecture();
OptionGroupArchitecture() = default;
~OptionGroupArchitecture() override;
~OptionGroupArchitecture() override = default;
llvm::ArrayRef<OptionDefinition> GetDefinitions() override;

View File

@ -25,7 +25,7 @@ public:
const char *usage_text, bool default_value,
bool no_argument_toggle_default);
~OptionGroupBoolean() override;
~OptionGroupBoolean() override = default;
llvm::ArrayRef<OptionDefinition> GetDefinitions() override {
return llvm::ArrayRef<OptionDefinition>(&m_option_definition, 1);

View File

@ -24,7 +24,7 @@ public:
lldb::CommandArgumentType argument_type,
const char *usage_text);
~OptionGroupFile() override;
~OptionGroupFile() override = default;
llvm::ArrayRef<OptionDefinition> GetDefinitions() override {
return llvm::ArrayRef<OptionDefinition>(&m_option_definition, 1);

View File

@ -32,13 +32,12 @@ public:
uint64_t default_count =
UINT64_MAX); // Pass UINT64_MAX to disable the "--count" option
~OptionGroupFormat() override;
~OptionGroupFormat() override = default;
llvm::ArrayRef<OptionDefinition> GetDefinitions() override;
Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_value,
ExecutionContext *execution_context) override;
Status SetOptionValue(uint32_t, const char *, ExecutionContext *) = delete;
void OptionParsingStarting(ExecutionContext *execution_context) override;

View File

@ -20,13 +20,12 @@ class OptionGroupOutputFile : public OptionGroup {
public:
OptionGroupOutputFile();
~OptionGroupOutputFile() override;
~OptionGroupOutputFile() override = default;
llvm::ArrayRef<OptionDefinition> GetDefinitions() override;
Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_value,
ExecutionContext *execution_context) override;
Status SetOptionValue(uint32_t, const char *, ExecutionContext *) = delete;
void OptionParsingStarting(ExecutionContext *execution_context) override;

View File

@ -29,7 +29,7 @@ public:
int key_option = 'k',
int value_option = 'v');
~OptionGroupPythonClassWithDict() override;
~OptionGroupPythonClassWithDict() override = default;
llvm::ArrayRef<OptionDefinition> GetDefinitions() override {
return llvm::ArrayRef<OptionDefinition>(m_option_definition);

View File

@ -22,7 +22,7 @@ public:
lldb::CommandArgumentType argument_type,
const char *usage_text, const char *default_value);
~OptionGroupString() override;
~OptionGroupString() override = default;
llvm::ArrayRef<OptionDefinition> GetDefinitions() override {
return llvm::ArrayRef<OptionDefinition>(&m_option_definition, 1);

View File

@ -23,7 +23,7 @@ public:
lldb::CommandArgumentType argument_type,
const char *usage_text, uint64_t default_value);
~OptionGroupUInt64() override;
~OptionGroupUInt64() override = default;
llvm::ArrayRef<OptionDefinition> GetDefinitions() override {
return llvm::ArrayRef<OptionDefinition>(&m_option_definition, 1);

View File

@ -18,9 +18,9 @@ namespace lldb_private {
class OptionGroupUUID : public OptionGroup {
public:
OptionGroupUUID();
OptionGroupUUID() = default;
~OptionGroupUUID() override;
~OptionGroupUUID() override = default;
llvm::ArrayRef<OptionDefinition> GetDefinitions() override;

View File

@ -18,9 +18,9 @@ namespace lldb_private {
class OptionGroupValueObjectDisplay : public OptionGroup {
public:
OptionGroupValueObjectDisplay();
OptionGroupValueObjectDisplay() = default;
~OptionGroupValueObjectDisplay() override;
~OptionGroupValueObjectDisplay() override = default;
llvm::ArrayRef<OptionDefinition> GetDefinitions() override;

View File

@ -20,7 +20,7 @@ class OptionGroupVariable : public OptionGroup {
public:
OptionGroupVariable(bool show_frame_options);
~OptionGroupVariable() override;
~OptionGroupVariable() override = default;
llvm::ArrayRef<OptionDefinition> GetDefinitions() override;

View File

@ -17,9 +17,9 @@ namespace lldb_private {
class OptionGroupWatchpoint : public OptionGroup {
public:
OptionGroupWatchpoint();
OptionGroupWatchpoint() = default;
~OptionGroupWatchpoint() override;
~OptionGroupWatchpoint() override = default;
static bool IsWatchSizeSupported(uint32_t watch_size);

View File

@ -17,7 +17,7 @@ namespace lldb_private {
class OptionValueArch : public OptionValue {
public:
OptionValueArch() : OptionValue(), m_current_value(), m_default_value() {}
OptionValueArch() = default;
OptionValueArch(const char *triple)
: OptionValue(), m_current_value(triple), m_default_value() {
@ -31,7 +31,7 @@ public:
: OptionValue(), m_current_value(current_value),
m_default_value(default_value) {}
~OptionValueArch() override {}
~OptionValueArch() override = default;
// Virtual subclass pure virtual overrides

View File

@ -19,7 +19,7 @@ public:
: OptionValueArray(
OptionValue::ConvertTypeToMask(OptionValue::eTypeString)) {}
~OptionValueArgs() override {}
~OptionValueArgs() override = default;
size_t GetArgs(Args &args);

View File

@ -20,7 +20,7 @@ public:
OptionValueArray(uint32_t type_mask = UINT32_MAX, bool raw_value_dump = false)
: m_type_mask(type_mask), m_values(), m_raw_value_dump(raw_value_dump) {}
~OptionValueArray() override {}
~OptionValueArray() override = default;
// Virtual subclass pure virtual overrides

View File

@ -21,7 +21,7 @@ public:
: OptionValue(), m_current_value(current_value),
m_default_value(default_value) {}
~OptionValueBoolean() override {}
~OptionValueBoolean() override = default;
// Virtual subclass pure virtual overrides

View File

@ -22,7 +22,7 @@ public:
: OptionValue(), m_current_value(current_value),
m_default_value(default_value) {}
~OptionValueChar() override {}
~OptionValueChar() override = default;
// Virtual subclass pure virtual overrides

View File

@ -22,7 +22,7 @@ public:
: OptionValue(), m_type_mask(type_mask), m_values(),
m_raw_value_dump(raw_value_dump) {}
~OptionValueDictionary() override {}
~OptionValueDictionary() override = default;
// Virtual subclass pure virtual overrides

View File

@ -31,7 +31,7 @@ public:
OptionValueEnumeration(const OptionEnumValues &enumerators, enum_type value);
~OptionValueEnumeration() override;
~OptionValueEnumeration() override = default;
// Virtual subclass pure virtual overrides

View File

@ -21,7 +21,7 @@ public:
OptionValueFileColonLine();
OptionValueFileColonLine(const llvm::StringRef input);
~OptionValueFileColonLine() override {}
~OptionValueFileColonLine() override = default;
OptionValue::Type GetType() const override { return eTypeFileLineColumn; }

View File

@ -25,7 +25,7 @@ public:
OptionValueFileSpec(const FileSpec &current_value,
const FileSpec &default_value, bool resolve = true);
~OptionValueFileSpec() override {}
~OptionValueFileSpec() override = default;
// Virtual subclass pure virtual overrides

View File

@ -18,12 +18,12 @@ namespace lldb_private {
class OptionValueFileSpecList : public OptionValue {
public:
OptionValueFileSpecList() : OptionValue(), m_current_value() {}
OptionValueFileSpecList() = default;
OptionValueFileSpecList(const FileSpecList &current_value)
: OptionValue(), m_current_value(current_value) {}
~OptionValueFileSpecList() override {}
~OptionValueFileSpecList() override = default;
// Virtual subclass pure virtual overrides

View File

@ -22,7 +22,7 @@ public:
: OptionValue(), m_current_value(current_value),
m_default_value(default_value) {}
~OptionValueFormat() override {}
~OptionValueFormat() override = default;
// Virtual subclass pure virtual overrides

View File

@ -18,7 +18,7 @@ class OptionValueFormatEntity : public OptionValue {
public:
OptionValueFormatEntity(const char *default_format);
~OptionValueFormatEntity() override {}
~OptionValueFormatEntity() override = default;
// Virtual subclass pure virtual overrides

View File

@ -25,7 +25,7 @@ public:
: OptionValue(), m_current_value(current_value),
m_default_value(default_value) {}
~OptionValueLanguage() override {}
~OptionValueLanguage() override = default;
// Virtual subclass pure virtual overrides

View File

@ -19,7 +19,7 @@ public:
OptionValuePathMappings(bool notify_changes)
: OptionValue(), m_path_mappings(), m_notify_changes(notify_changes) {}
~OptionValuePathMappings() override {}
~OptionValuePathMappings() override = default;
// Virtual subclass pure virtual overrides

View File

@ -23,8 +23,7 @@ class OptionValueProperties
: public OptionValue,
public std::enable_shared_from_this<OptionValueProperties> {
public:
OptionValueProperties()
: OptionValue(), m_name(), m_properties(), m_name_to_index() {}
OptionValueProperties() = default;
OptionValueProperties(ConstString name);

View File

@ -16,9 +16,7 @@ namespace lldb_private {
class OptionValueSInt64 : public OptionValue {
public:
OptionValueSInt64()
: OptionValue(), m_current_value(0), m_default_value(0),
m_min_value(INT64_MIN), m_max_value(INT64_MAX) {}
OptionValueSInt64() = default;
OptionValueSInt64(int64_t value)
: OptionValue(), m_current_value(value), m_default_value(value),
@ -29,12 +27,9 @@ public:
m_default_value(default_value), m_min_value(INT64_MIN),
m_max_value(INT64_MAX) {}
OptionValueSInt64(const OptionValueSInt64 &rhs)
: OptionValue(rhs), m_current_value(rhs.m_current_value),
m_default_value(rhs.m_default_value), m_min_value(rhs.m_min_value),
m_max_value(rhs.m_max_value) {}
OptionValueSInt64(const OptionValueSInt64 &rhs) = default;
~OptionValueSInt64() override {}
~OptionValueSInt64() override = default;
// Virtual subclass pure virtual overrides
@ -90,10 +85,10 @@ public:
int64_t GetMaximumValue() const { return m_max_value; }
protected:
int64_t m_current_value;
int64_t m_default_value;
int64_t m_min_value;
int64_t m_max_value;
int64_t m_current_value = 0;
int64_t m_default_value = 0;
int64_t m_min_value = INT64_MIN;
int64_t m_max_value = INT64_MAX;
};
} // namespace lldb_private

View File

@ -23,9 +23,7 @@ public:
enum Options { eOptionEncodeCharacterEscapeSequences = (1u << 0) };
OptionValueString()
: OptionValue(), m_current_value(), m_default_value(), m_options(),
m_validator(), m_validator_baton() {}
OptionValueString() = default;
OptionValueString(ValidatorCallback validator, void *baton = nullptr)
: OptionValue(), m_current_value(), m_default_value(), m_options(),
@ -125,8 +123,8 @@ protected:
std::string m_current_value;
std::string m_default_value;
Flags m_options;
ValidatorCallback m_validator;
void *m_validator_baton;
ValidatorCallback m_validator = nullptr;
void *m_validator_baton = nullptr;
};
} // namespace lldb_private

View File

@ -16,7 +16,7 @@ namespace lldb_private {
class OptionValueUInt64 : public OptionValue {
public:
OptionValueUInt64() : OptionValue(), m_current_value(0), m_default_value(0) {}
OptionValueUInt64() = default;
OptionValueUInt64(uint64_t value)
: OptionValue(), m_current_value(value), m_default_value(value) {}
@ -25,7 +25,7 @@ public:
: OptionValue(), m_current_value(current_value),
m_default_value(default_value) {}
~OptionValueUInt64() override {}
~OptionValueUInt64() override = default;
// Decode a uint64_t from "value_cstr" return a OptionValueUInt64 object
// inside of a lldb::OptionValueSP object if all goes well. If the string
@ -68,8 +68,8 @@ public:
void SetDefaultValue(uint64_t value) { m_default_value = value; }
protected:
uint64_t m_current_value;
uint64_t m_default_value;
uint64_t m_current_value = 0;
uint64_t m_default_value = 0;
};
} // namespace lldb_private

View File

@ -16,11 +16,11 @@ namespace lldb_private {
class OptionValueUUID : public OptionValue {
public:
OptionValueUUID() : OptionValue(), m_uuid() {}
OptionValueUUID() = default;
OptionValueUUID(const UUID &uuid) : OptionValue(), m_uuid(uuid) {}
~OptionValueUUID() override {}
~OptionValueUUID() override = default;
// Virtual subclass pure virtual overrides

View File

@ -85,7 +85,7 @@ public:
ScriptInterpreter(Debugger &debugger, lldb::ScriptLanguage script_lang);
~ScriptInterpreter() override;
~ScriptInterpreter() override = default;
struct ExecuteScriptOptions {
public:

View File

@ -13,10 +13,6 @@
using namespace lldb;
using namespace lldb_private;
CommandHistory::CommandHistory() : m_mutex(), m_history() {}
CommandHistory::~CommandHistory() {}
size_t CommandHistory::GetSize() const {
std::lock_guard<std::recursive_mutex> guard(m_mutex);
return m_history.size();

View File

@ -49,8 +49,6 @@ CommandObject::CommandObject(CommandInterpreter &interpreter,
m_cmd_syntax = std::string(syntax);
}
CommandObject::~CommandObject() {}
Debugger &CommandObject::GetDebugger() { return m_interpreter.GetDebugger(); }
llvm::StringRef CommandObject::GetHelp() { return m_cmd_help_short; }

View File

@ -45,8 +45,6 @@ CommandReturnObject::CommandReturnObject(bool colors)
m_status(eReturnStatusStarted), m_did_change_process_state(false),
m_interactive(true) {}
CommandReturnObject::~CommandReturnObject() {}
void CommandReturnObject::AppendErrorWithFormat(const char *format, ...) {
if (!format)
return;

View File

@ -13,10 +13,6 @@
using namespace lldb;
using namespace lldb_private;
OptionGroupArchitecture::OptionGroupArchitecture() : m_arch_str() {}
OptionGroupArchitecture::~OptionGroupArchitecture() {}
static constexpr OptionDefinition g_option_table[] = {
{LLDB_OPT_SET_1, false, "arch", 'a', OptionParser::eRequiredArgument,
nullptr, {}, 0, eArgTypeArchitecture,

View File

@ -33,8 +33,6 @@ OptionGroupBoolean::OptionGroupBoolean(uint32_t usage_mask, bool required,
m_option_definition.usage_text = usage_text;
}
OptionGroupBoolean::~OptionGroupBoolean() {}
Status OptionGroupBoolean::SetOptionValue(uint32_t option_idx,
llvm::StringRef option_value,
ExecutionContext *execution_context) {

View File

@ -31,8 +31,6 @@ OptionGroupFile::OptionGroupFile(uint32_t usage_mask, bool required,
m_option_definition.usage_text = usage_text;
}
OptionGroupFile::~OptionGroupFile() {}
Status OptionGroupFile::SetOptionValue(uint32_t option_idx,
llvm::StringRef option_arg,
ExecutionContext *execution_context) {

View File

@ -24,8 +24,6 @@ OptionGroupFormat::OptionGroupFormat(lldb::Format default_format,
m_count(default_count, default_count), m_prev_gdb_format('x'),
m_prev_gdb_size('w') {}
OptionGroupFormat::~OptionGroupFormat() {}
static constexpr OptionDefinition g_option_table[] = {
{LLDB_OPT_SET_1, false, "format", 'f', OptionParser::eRequiredArgument,
nullptr, {}, 0, eArgTypeFormat,

View File

@ -16,8 +16,6 @@ using namespace lldb_private;
OptionGroupOutputFile::OptionGroupOutputFile()
: m_file(), m_append(false, false) {}
OptionGroupOutputFile::~OptionGroupOutputFile() {}
static const uint32_t SHORT_OPTION_APND = 0x61706e64; // 'apnd'
static constexpr OptionDefinition g_option_table[] = {

View File

@ -81,8 +81,6 @@ OptionGroupPythonClassWithDict::OptionGroupPythonClassWithDict
}
OptionGroupPythonClassWithDict::~OptionGroupPythonClassWithDict() {}
Status OptionGroupPythonClassWithDict::SetOptionValue(
uint32_t option_idx,
llvm::StringRef option_arg,

View File

@ -32,8 +32,6 @@ OptionGroupString::OptionGroupString(uint32_t usage_mask, bool required,
m_option_definition.usage_text = usage_text;
}
OptionGroupString::~OptionGroupString() {}
Status OptionGroupString::SetOptionValue(uint32_t option_idx,
llvm::StringRef option_arg,
ExecutionContext *execution_context) {

View File

@ -32,8 +32,6 @@ OptionGroupUInt64::OptionGroupUInt64(uint32_t usage_mask, bool required,
m_option_definition.usage_text = usage_text;
}
OptionGroupUInt64::~OptionGroupUInt64() {}
Status OptionGroupUInt64::SetOptionValue(uint32_t option_idx,
llvm::StringRef option_arg,
ExecutionContext *execution_context) {

View File

@ -13,10 +13,6 @@
using namespace lldb;
using namespace lldb_private;
OptionGroupUUID::OptionGroupUUID() : m_uuid() {}
OptionGroupUUID::~OptionGroupUUID() {}
static constexpr OptionDefinition g_option_table[] = {
{LLDB_OPT_SET_1, false, "uuid", 'u', OptionParser::eRequiredArgument,
nullptr, {}, 0, eArgTypeModuleUUID, "A module UUID value."},

View File

@ -19,10 +19,6 @@
using namespace lldb;
using namespace lldb_private;
OptionGroupValueObjectDisplay::OptionGroupValueObjectDisplay() {}
OptionGroupValueObjectDisplay::~OptionGroupValueObjectDisplay() {}
static const OptionDefinition g_option_table[] = {
{LLDB_OPT_SET_1, false, "dynamic-type", 'd',
OptionParser::eRequiredArgument, nullptr, GetDynamicValueTypes(), 0,

View File

@ -70,8 +70,6 @@ OptionGroupVariable::OptionGroupVariable(bool show_frame_options)
: OptionGroup(), include_frame_options(show_frame_options),
summary(ValidateNamedSummary), summary_string(ValidateSummaryString) {}
OptionGroupVariable::~OptionGroupVariable() {}
Status
OptionGroupVariable::SetOptionValue(uint32_t option_idx,
llvm::StringRef option_arg,

View File

@ -74,10 +74,6 @@ bool OptionGroupWatchpoint::IsWatchSizeSupported(uint32_t watch_size) {
return false;
}
OptionGroupWatchpoint::OptionGroupWatchpoint() : OptionGroup() {}
OptionGroupWatchpoint::~OptionGroupWatchpoint() {}
Status
OptionGroupWatchpoint::SetOptionValue(uint32_t option_idx,
llvm::StringRef option_arg,

View File

@ -20,8 +20,6 @@ OptionValueEnumeration::OptionValueEnumeration(
SetEnumerations(enumerators);
}
OptionValueEnumeration::~OptionValueEnumeration() {}
void OptionValueEnumeration::DumpValue(const ExecutionContext *exe_ctx,
Stream &strm, uint32_t dump_mask) {
if (dump_mask & eDumpOptionType)

View File

@ -27,7 +27,7 @@ using namespace lldb_private;
// Options
Options::Options() : m_getopt_table() { BuildValidOptionSets(); }
Options::~Options() {}
Options::~Options() = default;
void Options::NotifyOptionParsingStarting(ExecutionContext *execution_context) {
m_seen_options.clear();

View File

@ -30,8 +30,6 @@ ScriptInterpreter::ScriptInterpreter(Debugger &debugger,
lldb::ScriptLanguage script_lang)
: m_debugger(debugger), m_script_lang(script_lang) {}
ScriptInterpreter::~ScriptInterpreter() {}
void ScriptInterpreter::CollectDataForBreakpointCommandCallback(
std::vector<BreakpointOptions *> &bp_options_vec,
CommandReturnObject &result) {