aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Interpreter/CommandObject.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2016-09-19 21:56:59 +0000
committerZachary Turner <zturner@google.com>2016-09-19 21:56:59 +0000
commit5c725f3a06b7f4236b3d98c14f1109a5852ed6ef (patch)
treed0c26cc2e45dbc6b5afc7d364ce058927ce61e3f /lldb/source/Interpreter/CommandObject.cpp
parentbf9a7c43b0c74a161c0a73164e59cc4785bb3085 (diff)
downloadllvm-5c725f3a06b7f4236b3d98c14f1109a5852ed6ef.zip
llvm-5c725f3a06b7f4236b3d98c14f1109a5852ed6ef.tar.gz
llvm-5c725f3a06b7f4236b3d98c14f1109a5852ed6ef.tar.bz2
Convert 3 more functions to use a StringRef.
This converts Args::Unshift, Args::AddOrReplaceEnvironmentVariable, and Args::ContainsEnvironmentVariable to use StringRefs. The code is also simplified somewhat as a result. llvm-svn: 281942
Diffstat (limited to 'lldb/source/Interpreter/CommandObject.cpp')
-rw-r--r--lldb/source/Interpreter/CommandObject.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lldb/source/Interpreter/CommandObject.cpp b/lldb/source/Interpreter/CommandObject.cpp
index 702939a..019fca9 100644
--- a/lldb/source/Interpreter/CommandObject.cpp
+++ b/lldb/source/Interpreter/CommandObject.cpp
@@ -116,7 +116,7 @@ bool CommandObject::ParseOptions(Args &args, CommandReturnObject &result) {
// ParseOptions calls getopt_long_only, which always skips the zero'th item
// in the array and starts at position 1,
// so we need to push a dummy value into position zero.
- args.Unshift("dummy_string");
+ args.Unshift(llvm::StringRef("dummy_string"));
const bool require_validation = true;
error = args.ParseOptions(*options, &exe_ctx,
GetCommandInterpreter().GetPlatform(true),
@@ -296,7 +296,7 @@ int CommandObject::HandleCompletion(Args &input, int &cursor_index,
if (cur_options != nullptr) {
// Re-insert the dummy command name string which will have been
// stripped off:
- input.Unshift("dummy-string");
+ input.Unshift(llvm::StringRef("dummy-string"));
cursor_index++;
// I stick an element on the end of the input, because if the last element