From 14f6b2c0351bf432169f7bf473aae75a5264492f Mon Sep 17 00:00:00 2001 From: Zachary Turner Date: Fri, 9 Dec 2016 01:08:29 +0000 Subject: Modernize the Args access pattern in a few more commands. llvm-svn: 289164 --- lldb/source/Commands/CommandObjectLog.cpp | 32 +++++-------------------------- 1 file changed, 5 insertions(+), 27 deletions(-) (limited to 'lldb/source/Commands/CommandObjectLog.cpp') diff --git a/lldb/source/Commands/CommandObjectLog.cpp b/lldb/source/Commands/CommandObjectLog.cpp index ab84ac6be3a..3fdd888d2ed 100644 --- a/lldb/source/Commands/CommandObjectLog.cpp +++ b/lldb/source/Commands/CommandObjectLog.cpp @@ -88,28 +88,6 @@ public: Options *GetOptions() override { return &m_options; } - // int - // HandleArgumentCompletion (Args &input, - // int &cursor_index, - // int &cursor_char_position, - // OptionElementVector &opt_element_vector, - // int match_start_point, - // int max_return_elements, - // bool &word_complete, - // StringList &matches) - // { - // std::string completion_str (input.GetArgumentAtIndex(cursor_index)); - // completion_str.erase (cursor_char_position); - // - // if (cursor_index == 1) - // { - // // - // Log::AutoCompleteChannelName (completion_str.c_str(), matches); - // } - // return matches.GetSize(); - // } - // - class CommandOptions : public Options { public: CommandOptions() : Options(), log_file(), log_options(0) {} @@ -186,7 +164,7 @@ protected: } // Store into a std::string since we're about to shift the channel off. - std::string channel = args.GetArgumentAtIndex(0); + const std::string channel = args[0].ref; args.Shift(); // Shift off the channel char log_file[PATH_MAX]; if (m_options.log_file) @@ -251,7 +229,7 @@ protected: Log::Callbacks log_callbacks; - const std::string channel = args.GetArgumentAtIndex(0); + const std::string channel = args[0].ref; args.Shift(); // Shift off the channel if (Log::GetLogChannelCallbacks(ConstString(channel), log_callbacks)) { log_callbacks.disable(args.GetConstArgumentVector(), @@ -350,7 +328,7 @@ protected: result.SetStatus(eReturnStatusFailed); if (args.GetArgumentCount() == 1) { - llvm::StringRef sub_command = args.GetArgumentAtIndex(0); + auto sub_command = args[0].ref; if (sub_command.equals_lower("enable")) { Timer::SetDisplayDepth(UINT32_MAX); @@ -367,8 +345,8 @@ protected: result.SetStatus(eReturnStatusSuccessFinishResult); } } else if (args.GetArgumentCount() == 2) { - llvm::StringRef sub_command = args.GetArgumentAtIndex(0); - llvm::StringRef param = args.GetArgumentAtIndex(1); + auto sub_command = args[0].ref; + auto param = args[1].ref; if (sub_command.equals_lower("enable")) { uint32_t depth; -- cgit v1.2.3