Modernize the Args access pattern in a few more commands.
llvm-svn: 289164
diff --git a/lldb/source/Commands/CommandObjectLog.cpp b/lldb/source/Commands/CommandObjectLog.cpp
index ab84ac6..3fdd888 100644
--- a/lldb/source/Commands/CommandObjectLog.cpp
+++ b/lldb/source/Commands/CommandObjectLog.cpp
@@ -88,28 +88,6 @@
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 @@
}
// 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 @@
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 @@
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 @@
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;