diff options
| author | Zachary Turner <zturner@google.com> | 2016-10-05 21:14:56 +0000 |
|---|---|---|
| committer | Zachary Turner <zturner@google.com> | 2016-10-05 21:14:56 +0000 |
| commit | a01bccdbe613f5e65fa8da2fb07d6b9b66d203bf (patch) | |
| tree | c16ba4c60dd4789d645227b2167cb31b4005804a /lldb/source/Interpreter/CommandInterpreter.cpp | |
| parent | a483f579428067c4e7ae7e6617edb67911151ae9 (diff) | |
| download | bcm5719-llvm-a01bccdbe613f5e65fa8da2fb07d6b9b66d203bf.tar.gz bcm5719-llvm-a01bccdbe613f5e65fa8da2fb07d6b9b66d203bf.zip | |
Convert some more aliasing and CI functions to StringRef.
llvm-svn: 283386
Diffstat (limited to 'lldb/source/Interpreter/CommandInterpreter.cpp')
| -rw-r--r-- | lldb/source/Interpreter/CommandInterpreter.cpp | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp index 1850f8739ad..6e845fa4050 100644 --- a/lldb/source/Interpreter/CommandInterpreter.cpp +++ b/lldb/source/Interpreter/CommandInterpreter.cpp @@ -1162,8 +1162,8 @@ void CommandInterpreter::GetHelp(CommandReturnObject &result, GetCommandPrefix()); } -CommandObject * -CommandInterpreter::GetCommandObjectForCommand(std::string &command_string) { +CommandObject *CommandInterpreter::GetCommandObjectForCommand( + llvm::StringRef &command_string) { // This function finds the final, lowest-level, alias-resolved command object // whose 'Execute' function will // eventually be invoked by the given command line. @@ -1182,8 +1182,7 @@ CommandInterpreter::GetCommandObjectForCommand(std::string &command_string) { if (cmd_obj == nullptr) // Since cmd_obj is NULL we are on our first time through this loop. - // Check to see if cmd_word is a valid - // command or alias. + // Check to see if cmd_word is a valid command or alias. cmd_obj = GetCommandObject(cmd_word); else if (cmd_obj->IsMultiwordObject()) { // Our current object is a multi-word object; see if the cmd_word is a @@ -1199,10 +1198,8 @@ CommandInterpreter::GetCommandObjectForCommand(std::string &command_string) { done = true; // If we didn't find a valid command object, or our command object is not - // a multi-word object, or - // we are at the end of the command_string, then we are done. Otherwise, - // find the start of the - // next word. + // a multi-word object, or we are at the end of the command_string, then + // we are done. Otherwise, find the start of the next word. if (!cmd_obj || !cmd_obj->IsMultiwordObject() || end >= command_string.size()) @@ -1214,11 +1211,7 @@ CommandInterpreter::GetCommandObjectForCommand(std::string &command_string) { done = true; } - if (end == command_string.size()) - command_string.clear(); - else - command_string = command_string.substr(end); - + command_string = command_string.substr(end); return cmd_obj; } |

