diff options
Diffstat (limited to 'lldb/source/Interpreter')
-rw-r--r-- | lldb/source/Interpreter/CommandObjectRegexCommand.cpp | 5 | ||||
-rw-r--r-- | lldb/source/Interpreter/OptionValueRegex.cpp | 3 |
2 files changed, 5 insertions, 3 deletions
diff --git a/lldb/source/Interpreter/CommandObjectRegexCommand.cpp b/lldb/source/Interpreter/CommandObjectRegexCommand.cpp index 16e6feb957c..94e52a36fb3 100644 --- a/lldb/source/Interpreter/CommandObjectRegexCommand.cpp +++ b/lldb/source/Interpreter/CommandObjectRegexCommand.cpp @@ -73,8 +73,9 @@ bool CommandObjectRegexCommand::AddRegexCommand(const char *re_cstr, const char *command_cstr) { m_entries.resize(m_entries.size() + 1); // Only add the regular expression if it compiles - if (m_entries.back().regex.Compile( - llvm::StringRef::withNullAsEmpty(re_cstr))) { + m_entries.back().regex = + RegularExpression(llvm::StringRef::withNullAsEmpty(re_cstr)); + if (m_entries.back().regex.IsValid()) { m_entries.back().command.assign(command_cstr); return true; } diff --git a/lldb/source/Interpreter/OptionValueRegex.cpp b/lldb/source/Interpreter/OptionValueRegex.cpp index eaf05928fc7..cf806fb550f 100644 --- a/lldb/source/Interpreter/OptionValueRegex.cpp +++ b/lldb/source/Interpreter/OptionValueRegex.cpp @@ -46,7 +46,8 @@ Status OptionValueRegex::SetValueFromString(llvm::StringRef value, case eVarSetOperationReplace: case eVarSetOperationAssign: - if (m_regex.Compile(value)) { + m_regex = RegularExpression(value); + if (m_regex.IsValid()) { m_value_was_set = true; NotifyValueChanged(); } else if (llvm::Error err = m_regex.GetError()) { |