[PATCH] D66141: [FileCheck] Forbid using var defined on same line

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 28 03:58:53 PDT 2019


jhenderson added a comment.

I just want to make sure I understand the aim here:

1. This partially reverts the behaviour introduced in rL366897 <https://reviews.llvm.org/rL366897> to prevent the issue with variables defined on the same line (but still allowing variables to be defined from an expression).
2. A later patch will fix and reintroduce this behaviour.

Is there anything in particular preventing you doing 2) straight away, making this patch redundant?

This is a minor point, but I wonder whether you should stop calling it "on the same line" and start saying "in the same check". If I'm not mistaken, a CHECK-SAME would allow for a usage of a variable in a different check from the one it was defined in, but matching on the same output line:

  0
  1 2
  CHECK:      [[#VAR1:]]
  CHECK-NEXT: [[#VAR2:VAR1+1]]
  CHECK-SAME: [[#VAR2+1]]



================
Comment at: llvm/unittests/Support/FileCheckTest.cpp:86-88
-  // Variable defined by numeric expression: isValueKnownAtMatchTime
-  // returns true, getValue and eval return value of expression, setValue
-  // clears expression.
----------------
I'm not sure I follow why this case has been deleted, if it's still valid to define a variable via an expression.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D66141





More information about the llvm-commits mailing list