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
diff --git a/lldb/source/Symbol/ObjectFile.cpp b/lldb/source/Symbol/ObjectFile.cpp
index fd233cc..4616208 100644
--- a/lldb/source/Symbol/ObjectFile.cpp
+++ b/lldb/source/Symbol/ObjectFile.cpp
@@ -574,9 +574,10 @@
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) &&