diff options
Diffstat (limited to 'contrib/llvm-project/lldb/source/Commands/CommandObjectSource.cpp')
-rw-r--r-- | contrib/llvm-project/lldb/source/Commands/CommandObjectSource.cpp | 30 |
1 files changed, 7 insertions, 23 deletions
diff --git a/contrib/llvm-project/lldb/source/Commands/CommandObjectSource.cpp b/contrib/llvm-project/lldb/source/Commands/CommandObjectSource.cpp index 6c6706f4a98b..f87981859844 100644 --- a/contrib/llvm-project/lldb/source/Commands/CommandObjectSource.cpp +++ b/contrib/llvm-project/lldb/source/Commands/CommandObjectSource.cpp @@ -36,7 +36,7 @@ using namespace lldb_private; class CommandObjectSourceInfo : public CommandObjectParsed { class CommandOptions : public Options { public: - CommandOptions() {} + CommandOptions() = default; ~CommandOptions() override = default; @@ -538,14 +538,6 @@ protected: } bool DoExecute(Args &command, CommandReturnObject &result) override { - const size_t argc = command.GetArgumentCount(); - - if (argc != 0) { - result.AppendErrorWithFormat("'%s' takes no arguments, only flags.\n", - GetCommandName().str().c_str()); - return false; - } - Target *target = m_exe_ctx.GetTargetPtr(); if (target == nullptr) { target = GetDebugger().GetSelectedTarget().get(); @@ -623,7 +615,7 @@ protected: class CommandObjectSourceList : public CommandObjectParsed { class CommandOptions : public Options { public: - CommandOptions() {} + CommandOptions() = default; ~CommandOptions() override = default; @@ -728,8 +720,8 @@ public: Options *GetOptions() override { return &m_options; } - const char *GetRepeatCommand(Args ¤t_command_args, - uint32_t index) override { + llvm::Optional<std::string> GetRepeatCommand(Args ¤t_command_args, + uint32_t index) override { // This is kind of gross, but the command hasn't been parsed yet so we // can't look at the option values for this invocation... I have to scan // the arguments directly. @@ -738,13 +730,13 @@ public: return e.ref() == "-r" || e.ref() == "--reverse"; }); if (iter == current_command_args.end()) - return m_cmd_name.c_str(); + return m_cmd_name; if (m_reverse_name.empty()) { m_reverse_name = m_cmd_name; m_reverse_name.append(" -r"); } - return m_reverse_name.c_str(); + return m_reverse_name; } protected: @@ -755,7 +747,7 @@ protected: SourceInfo(ConstString name, const LineEntry &line_entry) : function(name), line_entry(line_entry) {} - SourceInfo() {} + SourceInfo() = default; bool IsValid() const { return (bool)function && line_entry.IsValid(); } @@ -924,14 +916,6 @@ protected: } bool DoExecute(Args &command, CommandReturnObject &result) override { - const size_t argc = command.GetArgumentCount(); - - if (argc != 0) { - result.AppendErrorWithFormat("'%s' takes no arguments, only flags.\n", - GetCommandName().str().c_str()); - return false; - } - Target *target = m_exe_ctx.GetTargetPtr(); if (!m_options.symbol_name.empty()) { |