[PATCH] D60386: FileCheck [6/12]: Introduce numeric variable definition

Paul Robinson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 5 08:18:34 PDT 2019


probinson accepted this revision.
probinson added a comment.
This revision is now accepted and ready to land.

I am pretty sure all @jhenderson  comments have been addressed, and I'm happy, so LGTM.
As I said previously, it may be a while before I get to your next patch.



================
Comment at: llvm/include/llvm/Support/FileCheck.h:350
   /// VariableDefs will map "bar" to 2 corresponding to the second definition
   /// of "bar".
   ///
----------------
thopre wrote:
> probinson wrote:
> > I think what this is trying to say is:
> > the pattern "foo[[bar:.*]]baz[[bar]]quux[[bar:.*]]"
> > is translated into some regex with parentheses,
> > the second set of parentheses corresponds to the last definition of "bar" on the line,
> > hence VariableDefs will map "bar" to 2.
> > 
> > Is that right? The translation of check-line-with-square-brackets-with-regex into parenthesized-regex-passed-to-regex-library is not obvious in this comment as written.
> Indeed. The comment was already unclear before this patch series, I think the reason is in most cases the CHECK directive does not contain parenthesis so the square bracket definition maps directly to the parenthesis group number. Hopefully the comment is now clearer.
It looks odd that the translated expression has nothing for the use of `[[bar]]` in the original, but the comment is much better now, thanks!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D60386/new/

https://reviews.llvm.org/D60386





More information about the llvm-commits mailing list