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

Thomas Preud'homme via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 3 06:57:49 PDT 2019


thopre marked 3 inline comments as done.
thopre added inline comments.


================
Comment at: llvm/include/llvm/Support/FileCheck.h:249
+  /// defined.
+  std::shared_ptr<FileCheckNumExprVar> NumVarDef;
+
----------------
arsenm wrote:
> Why shared_ptr and not unique_ptr?
Fundamentally the lifetime of a variable definition is from the parsing of the definition until the expression with the last use is matched. Tying it to the pattern with the definition works in practice because all patterns are live until all have been matched so the lifetime is a superset but one could imagine patterns being in a queue that gets dequeued as soon as they are matched in which case std::unique_ptr would not work.

I thus feel this is more resilient.


================
Comment at: llvm/test/FileCheck/numeric-expression.txt:32-33
+; CHECK-NEXT: [[# VAR1c : ]]
+
+
+; Numeric expressions using variables defined on other lines without spaces
----------------
arsenm wrote:
> Should also check with 0, and a count that exceeds the number of lines in the file
I'm not sure to understand. 0 as the input instead of 11? Count of what?


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