diff options
Diffstat (limited to 'lldb/source/Commands')
-rw-r--r-- | lldb/source/Commands/CommandCompletions.cpp | 2 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectFrame.cpp | 2 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectType.cpp | 32 |
3 files changed, 19 insertions, 17 deletions
diff --git a/lldb/source/Commands/CommandCompletions.cpp b/lldb/source/Commands/CommandCompletions.cpp index 9a969d289be..1cff39c3734 100644 --- a/lldb/source/Commands/CommandCompletions.cpp +++ b/lldb/source/Commands/CommandCompletions.cpp @@ -454,7 +454,7 @@ CommandCompletions::SymbolCompleter::SymbolCompleter( pos = regex_str.insert(pos, '\\'); pos = find_if(pos + 2, regex_str.end(), regex_chars); } - m_regex.Compile(regex_str); + m_regex = RegularExpression(regex_str); } lldb::SearchDepth CommandCompletions::SymbolCompleter::GetDepth() { diff --git a/lldb/source/Commands/CommandObjectFrame.cpp b/lldb/source/Commands/CommandObjectFrame.cpp index eb54e354a63..1087c611169 100644 --- a/lldb/source/Commands/CommandObjectFrame.cpp +++ b/lldb/source/Commands/CommandObjectFrame.cpp @@ -534,7 +534,7 @@ protected: const size_t regex_start_index = regex_var_list.GetSize(); llvm::StringRef name_str = entry.ref; RegularExpression regex(name_str); - if (regex.Compile(name_str)) { + if (regex.IsValid()) { size_t num_matches = 0; const size_t num_new_regex_vars = variable_list->AppendVariablesIfUnique(regex, regex_var_list, diff --git a/lldb/source/Commands/CommandObjectType.cpp b/lldb/source/Commands/CommandObjectType.cpp index cbe0e37824c..0fe82b88c6c 100644 --- a/lldb/source/Commands/CommandObjectType.cpp +++ b/lldb/source/Commands/CommandObjectType.cpp @@ -691,8 +691,8 @@ protected: ConstString typeCS(arg_entry.ref); if (m_command_options.m_regex) { - RegularExpressionSP typeRX(new RegularExpression()); - if (!typeRX->Compile(arg_entry.ref)) { + RegularExpressionSP typeRX(new RegularExpression(arg_entry.ref)); + if (!typeRX->IsValid()) { result.AppendError( "regex format error (maybe this is not really a regex?)"); result.SetStatus(eReturnStatusFailed); @@ -1043,9 +1043,9 @@ protected: std::unique_ptr<RegularExpression> formatter_regex; if (m_options.m_category_regex.OptionWasSet()) { - category_regex.reset(new RegularExpression()); - if (!category_regex->Compile( - m_options.m_category_regex.GetCurrentValueAsRef())) { + category_regex.reset(new RegularExpression( + m_options.m_category_regex.GetCurrentValueAsRef())); + if (!category_regex->IsValid()) { result.AppendErrorWithFormat( "syntax error in category regular expression '%s'", m_options.m_category_regex.GetCurrentValueAsRef().str().c_str()); @@ -1056,8 +1056,9 @@ protected: if (argc == 1) { const char *arg = command.GetArgumentAtIndex(0); - formatter_regex.reset(new RegularExpression()); - if (!formatter_regex->Compile(llvm::StringRef::withNullAsEmpty(arg))) { + formatter_regex.reset( + new RegularExpression(llvm::StringRef::withNullAsEmpty(arg))); + if (!formatter_regex->IsValid()) { result.AppendErrorWithFormat("syntax error in regular expression '%s'", arg); result.SetStatus(eReturnStatusFailed); @@ -1629,8 +1630,8 @@ bool CommandObjectTypeSummaryAdd::AddSummary(ConstString type_name, } if (type == eRegexSummary) { - RegularExpressionSP typeRX(new RegularExpression()); - if (!typeRX->Compile(type_name.GetStringRef())) { + RegularExpressionSP typeRX(new RegularExpression(type_name.GetStringRef())); + if (!typeRX->IsValid()) { if (error) error->SetErrorString( "regex format error (maybe this is not really a regex?)"); @@ -2115,9 +2116,9 @@ protected: std::unique_ptr<RegularExpression> regex; if (argc == 1) { - regex.reset(new RegularExpression()); const char *arg = command.GetArgumentAtIndex(0); - if (!regex->Compile(llvm::StringRef::withNullAsEmpty(arg))) { + regex.reset(new RegularExpression(llvm::StringRef::withNullAsEmpty(arg))); + if (!regex->IsValid()) { result.AppendErrorWithFormat( "syntax error in category regular expression '%s'", arg); result.SetStatus(eReturnStatusFailed); @@ -2369,8 +2370,8 @@ bool CommandObjectTypeSynthAdd::AddSynth(ConstString type_name, } if (type == eRegexSynth) { - RegularExpressionSP typeRX(new RegularExpression()); - if (!typeRX->Compile(type_name.GetStringRef())) { + RegularExpressionSP typeRX(new RegularExpression(type_name.GetStringRef())); + if (!typeRX->IsValid()) { if (error) error->SetErrorString( "regex format error (maybe this is not really a regex?)"); @@ -2497,8 +2498,9 @@ private: } if (type == eRegexFilter) { - RegularExpressionSP typeRX(new RegularExpression()); - if (!typeRX->Compile(type_name.GetStringRef())) { + RegularExpressionSP typeRX( + new RegularExpression(type_name.GetStringRef())); + if (!typeRX->IsValid()) { if (error) error->SetErrorString( "regex format error (maybe this is not really a regex?)"); |