summaryrefslogtreecommitdiffstats
path: root/lldb/source/Commands/CommandObjectLog.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2016-12-09 01:08:29 +0000
committerZachary Turner <zturner@google.com>2016-12-09 01:08:29 +0000
commit14f6b2c0351bf432169f7bf473aae75a5264492f (patch)
tree8f335efbc98f61e0f9d0dc090a0ab8019151be5c /lldb/source/Commands/CommandObjectLog.cpp
parent86f0bdf83205fb49cf46acf98cc2736ef85bf984 (diff)
downloadbcm5719-llvm-14f6b2c0351bf432169f7bf473aae75a5264492f.tar.gz
bcm5719-llvm-14f6b2c0351bf432169f7bf473aae75a5264492f.zip
Modernize the Args access pattern in a few more commands.
llvm-svn: 289164
Diffstat (limited to 'lldb/source/Commands/CommandObjectLog.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectLog.cpp32
1 files changed, 5 insertions, 27 deletions
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;
OpenPOWER on IntegriCloud