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

Alexander Kornienko via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 23 17:54:26 PDT 2016


alexfh requested changes to this revision.
This revision now requires changes to proceed.

================
Comment at: docs/CommandGuide/FileCheck.rst:485
@@ +484,3 @@
+Repeat in regular expressions
+~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
----------------
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.

================
Comment at: test/FileCheck/repeat-in-regex.txt:1
@@ +1,2 @@
+// RUN: FileCheck -input-file %s %s
+
----------------
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?

================
Comment at: utils/FileCheck/FileCheck.cpp:242
@@ +241,3 @@
+      size_t NextChar = End + 2;
+      while (NextChar < PatternStr.size() && PatternStr[NextChar] == '}') {
+        NextChar++;
----------------
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;



https://reviews.llvm.org/D22454





More information about the llvm-commits mailing list