[PATCH] D22454: FileCheck Enhancement - repeats in regular expressions

Elena Lepilkina via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 25 23:50:19 PDT 2016


eklepilkina added inline comments.

================
Comment at: docs/CommandGuide/FileCheck.rst:485
@@ +484,3 @@
+Repeat in regular expressions
+~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
----------------
alexfh wrote:
> Seems like this doesn't need a separate mention in the FileCheck documentation: it's just a feature of the regular expressions, and it should just work.
I added, because this feature doesn't  work before.  I think that description in documantation isn't extra. I agree that it may be replaced.

================
Comment at: test/FileCheck/repeat-in-regex.txt:1
@@ +1,2 @@
+// RUN: FileCheck -input-file %s %s
+
----------------
alexfh wrote:
> Will `{{ˆ}}}` still match a closing curly brace at the start of line? In general, there are tests that use `}}}` in the CHECK lines, and the change in how this sequence is parsed can affect them. Have you tried to run all LLVM and Clang tests with this change?
Yes, I did. I ran all LLVM and Clang tests with this patch.

================
Comment at: utils/FileCheck/FileCheck.cpp:242
@@ +241,3 @@
+      size_t NextChar = End + 2;
+      while (NextChar < PatternStr.size() && PatternStr[NextChar] == '}') {
+        NextChar++;
----------------
alexfh wrote:
> How about a bit more self-documenting version?
> 
>   StringRef::size_type LastBrace = PatternStr.find_first_not_of('}', EndChar);
>   if (LastBrace != StringRef::npos)
>     EndChar = LastBrace - 1;
> 
But if there is npos, then there won't be any shift even if last characters are }}} and End will be smaller then it should be.


https://reviews.llvm.org/D22454





More information about the llvm-commits mailing list