[PATCH] D49084: FileCheck: Add support for numeric variables and expressions

Paul Robinson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 20 12:48:11 PST 2018


probinson added a comment.

I am willing to review this; however it is a very large patch, which will take time to go through. Also, after tomorrow, I am on holiday until 3 January.

Some parts of it look like they could be split off into separate patches; for example, the command-line option handling looks like it could be done separately. I wonder if the refactoring of the `@LINE` handling into the new expression handling could also be separated out.
If not, that's okay, it will just make the review take a bit longer.

As a first step, I have a structural suggestion for the documentation. Once that is done, I will probably have some more detailed comments on wording, but they can wait for now.



================
Comment at: docs/CommandGuide/FileCheck.rst:570
+The syntax for numeric expression is
+``[[#%<fmtspec>,<NUMVAR>: <constraint> <expr>]]`` where:
+* ``%<fmtspec>`` is an optional printf-style matching format specifier to
----------------
The topic and syntax are more complicated than anything else FileCheck does, so I think it would be better separate the syntax description into two parts: using numeric expressions, and defining numeric variables. The syntax for a numeric expression would be
`[[# <constraint> <expr> ]]`
and then you can describe how to define the variables,
`[[# <fmtspec>,<NUMVAR>: <constraint> <expr> ]]`
which builds on the syntax for using variables.  I think this ordering will be easier to explain and to understand.


================
Comment at: docs/CommandGuide/FileCheck.rst:596
+    ; CHECK: add r[[#REG:]], [[#REG]], [[#REG+1]]
+    ; CHECK: copying from [[#%x,ADDR:] to [[#ADDR + 8]]
+
----------------
Please give examples of what these lines will match, and what they will not match.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D49084





More information about the llvm-commits mailing list