[llvm] r369396 - Regex: Add isValid() with no parameter
Jan Kratochvil via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 20 09:05:23 PDT 2019
Author: jankratochvil
Date: Tue Aug 20 09:05:23 2019
New Revision: 369396
URL: http://llvm.org/viewvc/llvm-project?rev=369396&view=rev
Log:
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
Modified:
llvm/trunk/include/llvm/Support/Regex.h
Modified: llvm/trunk/include/llvm/Support/Regex.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Regex.h?rev=369396&r1=369395&r2=369396&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/Regex.h (original)
+++ llvm/trunk/include/llvm/Support/Regex.h Tue Aug 20 09:05:23 2019
@@ -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
More information about the llvm-commits
mailing list