diff options
author | Zachary Turner <zturner@google.com> | 2016-09-19 17:54:06 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2016-09-19 17:54:06 +0000 |
commit | ecbb0bb1690cd59da0224d7b906f968356b1265c (patch) | |
tree | 90951f44a7abb40b355e849a2e64cb09ec3ac900 /lldb/source/Interpreter/CommandObject.cpp | |
parent | 495b211a6c775e6fbc00a1e3a91786f6a880b82e (diff) | |
download | llvm-ecbb0bb1690cd59da0224d7b906f968356b1265c.zip llvm-ecbb0bb1690cd59da0224d7b906f968356b1265c.tar.gz llvm-ecbb0bb1690cd59da0224d7b906f968356b1265c.tar.bz2 |
Fix more functions in Args to use StringRef.
This patch also marks the const char* versions as =delete to prevent
their use. This has the potential to cause build breakages on some
platforms which I can't compile. I have tested on Windows, Linux,
and OSX. Best practices for fixing broken callsites are outlined in
Args.h in a comment above the deleted function declarations.
Eventually we can remove these =delete declarations, but for now they
are important to make sure that all implicit conversions from
const char * are manually audited to make sure that they do not invoke a
conversion from nullptr.
llvm-svn: 281919
Diffstat (limited to 'lldb/source/Interpreter/CommandObject.cpp')
-rw-r--r-- | lldb/source/Interpreter/CommandObject.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lldb/source/Interpreter/CommandObject.cpp b/lldb/source/Interpreter/CommandObject.cpp index d42d3c7..702939a 100644 --- a/lldb/source/Interpreter/CommandObject.cpp +++ b/lldb/source/Interpreter/CommandObject.cpp @@ -300,10 +300,9 @@ int CommandObject::HandleCompletion(Args &input, int &cursor_index, cursor_index++; // I stick an element on the end of the input, because if the last element - // is - // option that requires an argument, getopt_long_only will freak out. + // is option that requires an argument, getopt_long_only will freak out. - input.AppendArgument("<FAKE-VALUE>"); + input.AppendArgument(llvm::StringRef("<FAKE-VALUE>")); input.ParseArgsForCompletion(*cur_options, opt_element_vector, cursor_index); @@ -1001,7 +1000,8 @@ bool CommandObjectParsed::Execute(const char *args_string, const char *tmp_str = cmd_args.GetArgumentAtIndex(i); if (tmp_str[0] == '`') // back-quote cmd_args.ReplaceArgumentAtIndex( - i, m_interpreter.ProcessEmbeddedScriptCommands(tmp_str)); + i, llvm::StringRef::withNullAsEmpty( + m_interpreter.ProcessEmbeddedScriptCommands(tmp_str))); } if (CheckRequirements(result)) { |