[PATCH] D64230: [FileCheck] Record numeric variable availability

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 8 03:08:26 PDT 2019


jhenderson added inline comments.


================
Comment at: llvm/include/llvm/Support/FileCheck.h:52
 
-  /// Line number where this variable is defined. Used to determine whether a
-  /// variable is defined on the same line as a given use.
-  size_t DefLineNumber;
+  /// Line number where this variable's value becomes available.
+  size_t AvailLineNumber;
----------------
thopre wrote:
> jhenderson wrote:
> > I'm not sure it's clear to me what "available" means in this context if it doesn't mean definition.
> The change in naming is mostly for pseudo variables (@LINE being the only at the moment) where the definition is implicit and thus there isn't a definition line number per se. However I think it makes sense to talk about value availability (e.g. @LINE only has a value from the first line in the CHECK file, whereas other variable have their value available from after their definition).
I could spin it another way. The @LINE variable is defined anew on each line, with the value of the input line number. Alternatively, it is defined on the first line, and updated thereafter. Thus its definition line is equal to its current value, or the first time it was defined (i.e. line 1), whichever is more useful.

Thinking in C++ terms, there is no concept of variable "availability". You have scope, definition, and declaration as related words. Thus variable availability is not a concept that people necessarily will understand.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D64230





More information about the llvm-commits mailing list