diff options
author | Zachary Turner <zturner@google.com> | 2016-11-21 23:18:07 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2016-11-21 23:18:07 +0000 |
commit | 1c55c9b5bf820a25ecf040fc3a5a1488b1d65cb2 (patch) | |
tree | 2ca0a559a8f8c36f3055919c15f379cfaf71df79 /lldb/source/Commands/CommandObjectCommands.cpp | |
parent | c2cd4e004c4b34d8be0333b3dfe80831661bf11d (diff) | |
download | bcm5719-llvm-1c55c9b5bf820a25ecf040fc3a5a1488b1d65cb2.tar.gz bcm5719-llvm-1c55c9b5bf820a25ecf040fc3a5a1488b1d65cb2.zip |
Add the new Args / entry-access API.
The long-term goal here is to get rid of the functions
GetArgumentAtIndex() and GetQuoteCharAtIndex(), instead
replacing them with operator based access and range-based for
enumeration. There are a lot of callsites, though, so the
changes will be done incrementally, starting with this one.
Differential Revision: https://reviews.llvm.org/D26883
llvm-svn: 287597
Diffstat (limited to 'lldb/source/Commands/CommandObjectCommands.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectCommands.cpp | 6 |
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(); } |