From f9d90bc5f690de43cbfd8bd15f6f3d3e01471615 Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Tue, 20 Aug 2019 09:24:20 +0000 Subject: [lldb] D66174 `RegularExpression` cleanup I find as a good cleanup to drop the Compile method. As I do not find TIMTOWTDI as an advantage and there is already constructor parameter to compile the regex. Differential Revision: https://reviews.llvm.org/D66392 llvm-svn: 369352 --- lldb/source/Interpreter/CommandObjectRegexCommand.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lldb/source/Interpreter/CommandObjectRegexCommand.cpp') 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; } -- cgit v1.2.3