From 95eae4235d4cfa5cee67ab6c4e686baf8a57e9e5 Mon Sep 17 00:00:00 2001 From: Zachary Turner Date: Wed, 21 Sep 2016 16:01:28 +0000 Subject: 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 --- .../RenderScriptRuntime/RenderScriptRuntime.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime') diff --git a/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp b/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp index 832f50dba88..9d751a75da0 100644 --- a/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp +++ b/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp @@ -1964,8 +1964,9 @@ void RenderScriptRuntime::FindStructTypeName(Element &elem, // Find all the global variables from the script rs modules VariableList variable_list; for (auto module_sp : m_rsmodules) - module_sp->m_module->FindGlobalVariables(RegularExpression("."), true, - UINT32_MAX, variable_list); + module_sp->m_module->FindGlobalVariables( + RegularExpression(llvm::StringRef(".")), true, UINT32_MAX, + variable_list); // Iterate over all the global variables looking for one with a matching type // to the Element. @@ -3741,15 +3742,16 @@ public: RegularExpression regex; RegularExpression::Match regex_match(3); + llvm::StringRef id_ref = llvm::StringRef::withNullAsEmpty(id_cstr); bool matched = false; - if (regex.Compile("^([0-9]+),([0-9]+),([0-9]+)$") && - regex.Execute(id_cstr, ®ex_match)) + if (regex.Compile(llvm::StringRef("^([0-9]+),([0-9]+),([0-9]+)$")) && + regex.Execute(id_ref, ®ex_match)) matched = true; - else if (regex.Compile("^([0-9]+),([0-9]+)$") && - regex.Execute(id_cstr, ®ex_match)) + else if (regex.Compile(llvm::StringRef("^([0-9]+),([0-9]+)$")) && + regex.Execute(id_ref, ®ex_match)) matched = true; - else if (regex.Compile("^([0-9]+)$") && - regex.Execute(id_cstr, ®ex_match)) + else if (regex.Compile(llvm::StringRef("^([0-9]+)$")) && + regex.Execute(id_ref, ®ex_match)) matched = true; for (uint32_t i = 0; i < 3; i++) { std::string group; -- cgit v1.2.3