From 453d973267b62435a1ae1c59f0cc0ad38f441696 Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Tue, 20 Aug 2019 16:05:23 +0000 Subject: [PATCH] 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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369396 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Support/Regex.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/llvm/Support/Regex.h b/include/llvm/Support/Regex.h index b05349dee88..ca5e8cd79a6 100644 --- a/include/llvm/Support/Regex.h +++ b/include/llvm/Support/Regex.h @@ -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 -- 2.49.0