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/Symbol | |
| 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/Symbol')
| -rw-r--r-- | lldb/source/Symbol/ObjectFile.cpp | 5 | ||||
| -rw-r--r-- | lldb/source/Symbol/Variable.cpp | 6 |
2 files changed, 7 insertions, 4 deletions
diff --git a/lldb/source/Symbol/ObjectFile.cpp b/lldb/source/Symbol/ObjectFile.cpp index fd233ccd81c..461620860c9 100644 --- a/lldb/source/Symbol/ObjectFile.cpp +++ b/lldb/source/Symbol/ObjectFile.cpp @@ -574,9 +574,10 @@ bool ObjectFile::SplitArchivePathWithObject(const char *path_with_object, FileSpec &archive_file, ConstString &archive_object, bool must_exist) { - RegularExpression g_object_regex("(.*)\\(([^\\)]+)\\)$"); + RegularExpression g_object_regex(llvm::StringRef("(.*)\\(([^\\)]+)\\)$")); RegularExpression::Match regex_match(2); - if (g_object_regex.Execute(path_with_object, ®ex_match)) { + if (g_object_regex.Execute(llvm::StringRef::withNullAsEmpty(path_with_object), + ®ex_match)) { std::string path; std::string obj; if (regex_match.GetMatchAtIndex(path_with_object, 1, path) && diff --git a/lldb/source/Symbol/Variable.cpp b/lldb/source/Symbol/Variable.cpp index 6ba6cf94106..d500395da33 100644 --- a/lldb/source/Symbol/Variable.cpp +++ b/lldb/source/Symbol/Variable.cpp @@ -382,9 +382,11 @@ Error Variable::GetValuesForVariableExpressionPath( } break; default: { - static RegularExpression g_regex("^([A-Za-z_:][A-Za-z_0-9:]*)(.*)"); + static RegularExpression g_regex( + llvm::StringRef("^([A-Za-z_:][A-Za-z_0-9:]*)(.*)")); RegularExpression::Match regex_match(1); - if (g_regex.Execute(variable_expr_path, ®ex_match)) { + if (g_regex.Execute(llvm::StringRef::withNullAsEmpty(variable_expr_path), + ®ex_match)) { std::string variable_name; if (regex_match.GetMatchAtIndex(variable_expr_path, 1, variable_name)) { variable_list.Clear(); |

