summaryrefslogtreecommitdiffstats
path: root/lldb/source/Commands/CommandObjectCommands.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2016-11-22 17:10:15 +0000
committerZachary Turner <zturner@google.com>2016-11-22 17:10:15 +0000
commitd6a24757876e7c1d29113f41ea241db262d9609c (patch)
tree8bc7a925d2d5bb5cc73b321929e7414f19947577 /lldb/source/Commands/CommandObjectCommands.cpp
parent04dc211e6aa5936caf72297e2c305d2ae23096dd (diff)
downloadbcm5719-llvm-d6a24757876e7c1d29113f41ea241db262d9609c.tar.gz
bcm5719-llvm-d6a24757876e7c1d29113f41ea241db262d9609c.zip
Re-add "demonstrate new Args API"
This fixes the build breakage due to the use of C++14. llvm-svn: 287647
Diffstat (limited to 'lldb/source/Commands/CommandObjectCommands.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectCommands.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lldb/source/Commands/CommandObjectCommands.cpp b/lldb/source/Commands/CommandObjectCommands.cpp
index 946bb83aa8f..f1fa7b8ee7d 100644
--- a/lldb/source/Commands/CommandObjectCommands.cpp
+++ b/lldb/source/Commands/CommandObjectCommands.cpp
@@ -1476,12 +1476,12 @@ public:
int match_start_point, int max_return_elements,
bool &word_complete,
StringList &matches) override {
- std::string completion_str(input.GetArgumentAtIndex(cursor_index));
- completion_str.erase(cursor_char_position);
+ llvm::StringRef completion_str = input[cursor_index].ref;
+ completion_str = completion_str.take_front(cursor_char_position);
CommandCompletions::InvokeCommonCompletionCallbacks(
GetCommandInterpreter(), CommandCompletions::eDiskFileCompletion,
- completion_str.c_str(), match_start_point, max_return_elements, nullptr,
+ completion_str, match_start_point, max_return_elements, nullptr,
word_complete, matches);
return matches.GetSize();
}
OpenPOWER on IntegriCloud