diff options
author | Zachary Turner <zturner@google.com> | 2016-09-21 16:01:28 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2016-09-21 16:01:28 +0000 |
commit | 95eae4235d4cfa5cee67ab6c4e686baf8a57e9e5 (patch) | |
tree | 0e9d2a42e76e13cf5ed5d6a8f0b935a83e40ea69 /lldb/source/Commands/CommandObjectTarget.cpp | |
parent | 07171f21d148d340115ec634be6a7f296799517d (diff) | |
download | bcm5719-llvm-95eae4235d4cfa5cee67ab6c4e686baf8a57e9e5.tar.gz bcm5719-llvm-95eae4235d4cfa5cee67ab6c4e686baf8a57e9e5.zip |
Make lldb::Regex use StringRef.
This updates getters and setters to use StringRef instead of
const char *. I tested the build on Linux, Windows, and OSX
and saw no build or test failures. I cannot test any BSD
or Android variants, however I expect the required changes
to be minimal or non-existant.
llvm-svn: 282079
Diffstat (limited to 'lldb/source/Commands/CommandObjectTarget.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectTarget.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lldb/source/Commands/CommandObjectTarget.cpp b/lldb/source/Commands/CommandObjectTarget.cpp index d7e4dfa2e9d..321341cd861 100644 --- a/lldb/source/Commands/CommandObjectTarget.cpp +++ b/lldb/source/Commands/CommandObjectTarget.cpp @@ -807,7 +807,7 @@ protected: size_t matches = 0; bool use_var_name = false; if (m_option_variable.use_regex) { - RegularExpression regex(arg); + RegularExpression regex(llvm::StringRef::withNullAsEmpty(arg)); if (!regex.IsValid()) { result.GetErrorStream().Printf( "error: invalid regular expression: '%s'\n", arg); @@ -941,7 +941,8 @@ protected: } else if (sc.module_sp) { // Get all global variables for this module lldb_private::RegularExpression all_globals_regex( - "."); // Any global with at least one character + llvm::StringRef( + ".")); // Any global with at least one character VariableList variable_list; sc.module_sp->FindGlobalVariables(all_globals_regex, append, UINT32_MAX, variable_list); @@ -1517,7 +1518,7 @@ static uint32_t LookupSymbolInModule(CommandInterpreter &interpreter, ConstString symbol_name(name); uint32_t num_matches = 0; if (name_is_regex) { - RegularExpression name_regexp(name); + RegularExpression name_regexp(symbol_name.GetStringRef()); num_matches = symtab->AppendSymbolIndexesMatchingRegExAndType( name_regexp, eSymbolTypeAny, match_indexes); } else { @@ -1579,7 +1580,7 @@ static size_t LookupFunctionInModule(CommandInterpreter &interpreter, const bool append = true; size_t num_matches = 0; if (name_is_regex) { - RegularExpression function_name_regex(name); + RegularExpression function_name_regex((llvm::StringRef(name))); num_matches = module->FindFunctions(function_name_regex, include_symbols, include_inlines, append, sc_list); } else { |