diff options
author | Jonas Devlieghere <jonas@devlieghere.com> | 2019-08-16 21:25:36 +0000 |
---|---|---|
committer | Jonas Devlieghere <jonas@devlieghere.com> | 2019-08-16 21:25:36 +0000 |
commit | 3af3f1e8e253d93cb655388af69f4ed1722b4f51 (patch) | |
tree | 44b9e8ecf404119a1a81b54e27ea6559a5f5dd9a /lldb/source/Commands/CommandObjectBreakpoint.cpp | |
parent | 250aafa2c4a1bc2395edfe8d4365545bbe56fffe (diff) | |
download | llvm-3af3f1e8e253d93cb655388af69f4ed1722b4f51.zip llvm-3af3f1e8e253d93cb655388af69f4ed1722b4f51.tar.gz llvm-3af3f1e8e253d93cb655388af69f4ed1722b4f51.tar.bz2 |
[Utility] Reimplement RegularExpression on top of llvm::Regex
Originally I wanted to remove the RegularExpression class in Utility and
replace it with llvm::Regex. However, during that transition I noticed
that there are several places where need the regular expression string.
So instead I propose to keep the RegularExpression class and make it a
thin wrapper around llvm::Regex.
This patch also removes the workaround for empty regular expressions.
The result is that we are now (more or less) POSIX conformant.
Differential revision: https://reviews.llvm.org/D66174
llvm-svn: 369153
Diffstat (limited to 'lldb/source/Commands/CommandObjectBreakpoint.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectBreakpoint.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/lldb/source/Commands/CommandObjectBreakpoint.cpp b/lldb/source/Commands/CommandObjectBreakpoint.cpp index 96e38ed..079e853 100644 --- a/lldb/source/Commands/CommandObjectBreakpoint.cpp +++ b/lldb/source/Commands/CommandObjectBreakpoint.cpp @@ -682,12 +682,10 @@ protected: // name { RegularExpression regexp(m_options.m_func_regexp); - if (!regexp.IsValid()) { - char err_str[1024]; - regexp.GetErrorAsCString(err_str, sizeof(err_str)); + if (llvm::Error err = regexp.GetError()) { result.AppendErrorWithFormat( "Function name regular expression could not be compiled: \"%s\"", - err_str); + llvm::toString(std::move(err)).c_str()); result.SetStatus(eReturnStatusFailed); return false; } @@ -718,12 +716,10 @@ protected: } RegularExpression regexp(m_options.m_source_text_regexp); - if (!regexp.IsValid()) { - char err_str[1024]; - regexp.GetErrorAsCString(err_str, sizeof(err_str)); + if (llvm::Error err = regexp.GetError()) { result.AppendErrorWithFormat( "Source text regular expression could not be compiled: \"%s\"", - err_str); + llvm::toString(std::move(err)).c_str()); result.SetStatus(eReturnStatusFailed); return false; } |