Regex: Add isValid() with no parameter

There will be some performance (only a little) improvement for LLDB's
RegularExpression::Execute.

Differential Revision: https://reviews.llvm.org/D66463

llvm-svn: 369396
This commit is contained in:
Jan Kratochvil 2019-08-20 16:05:23 +00:00
parent be699bf389
commit ed602ef480
1 changed files with 1 additions and 0 deletions

View File

@ -60,6 +60,7 @@ namespace llvm {
/// isValid - returns the error encountered during regex compilation, or
/// matching, if any.
bool isValid(std::string &Error) const;
bool isValid() const { return !error; }
/// getNumMatches - In a valid regex, return the number of parenthesized
/// matches it contains. The number filled in by match will include this