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/DataFormatters/FormattersHelpers.cpp b/lldb/source/DataFormatters/FormattersHelpers.cpp
index 842237f..68802b9 100644
--- a/lldb/source/DataFormatters/FormattersHelpers.cpp
+++ b/lldb/source/DataFormatters/FormattersHelpers.cpp
@@ -34,7 +34,7 @@
 
   if (regex)
     category_sp->GetRegexTypeFormatsContainer()->Add(
-        RegularExpressionSP(new RegularExpression(type_name.AsCString())),
+        RegularExpressionSP(new RegularExpression(type_name.GetStringRef())),
         format_sp);
   else
     category_sp->GetTypeFormatsContainer()->Add(type_name, format_sp);
@@ -45,7 +45,7 @@
     ConstString type_name, bool regex) {
   if (regex)
     category_sp->GetRegexTypeSummariesContainer()->Add(
-        RegularExpressionSP(new RegularExpression(type_name.AsCString())),
+        RegularExpressionSP(new RegularExpression(type_name.GetStringRef())),
         summary_sp);
   else
     category_sp->GetTypeSummariesContainer()->Add(type_name, summary_sp);
@@ -58,7 +58,7 @@
 
   if (regex)
     category_sp->GetRegexTypeSummariesContainer()->Add(
-        RegularExpressionSP(new RegularExpression(type_name.AsCString())),
+        RegularExpressionSP(new RegularExpression(type_name.GetStringRef())),
         summary_sp);
   else
     category_sp->GetTypeSummariesContainer()->Add(type_name, summary_sp);
@@ -72,7 +72,7 @@
 
   if (regex)
     category_sp->GetRegexTypeSummariesContainer()->Add(
-        RegularExpressionSP(new RegularExpression(type_name.AsCString())),
+        RegularExpressionSP(new RegularExpression(type_name.GetStringRef())),
         summary_sp);
   else
     category_sp->GetTypeSummariesContainer()->Add(type_name, summary_sp);
@@ -87,7 +87,7 @@
       new CXXFunctionSummaryFormat(flags, funct, description));
   if (regex)
     category_sp->GetRegexTypeSummariesContainer()->Add(
-        RegularExpressionSP(new RegularExpression(type_name.AsCString())),
+        RegularExpressionSP(new RegularExpression(type_name.GetStringRef())),
         summary_sp);
   else
     category_sp->GetTypeSummariesContainer()->Add(type_name, summary_sp);
@@ -102,7 +102,7 @@
       new CXXSyntheticChildren(flags, description, generator));
   if (regex)
     category_sp->GetRegexTypeSyntheticsContainer()->Add(
-        RegularExpressionSP(new RegularExpression(type_name.AsCString())),
+        RegularExpressionSP(new RegularExpression(type_name.GetStringRef())),
         synth_sp);
   else
     category_sp->GetTypeSyntheticsContainer()->Add(type_name, synth_sp);
@@ -117,7 +117,7 @@
     filter_sp->AddExpressionPath(child);
   if (regex)
     category_sp->GetRegexTypeFiltersContainer()->Add(
-        RegularExpressionSP(new RegularExpression(type_name.AsCString())),
+        RegularExpressionSP(new RegularExpression(type_name.GetStringRef())),
         filter_sp);
   else
     category_sp->GetTypeFiltersContainer()->Add(type_name, filter_sp);