[PATCH] D49084: FileCheck: Add support for variable expressions
Alexander Richardson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 12 14:33:08 PDT 2018
arichardson added a comment.
I case people are interested I have also implemented something similar in our fork of llvm. I chose `[[@EXPR var + 0x42]]` as the syntax. I also added some functions such as `[[@EXPR hex(VAR)]]`.
Variables can either by referenced by name or if they conflict with one of the builtin functions using `${x}` syntax: `[[@EXPR toupper(hex(${hex}))]]`
Some examples of what it can do can be seen here: https://github.com/CTSRD-CHERI/llvm/blob/master/test/FileCheck/expressions.txt
The implementation is IMO quite ugly (mostly a stripped down copy of lld's linker script parser) so I never got around to cleaning it up for upstream submission.
Repository:
rL LLVM
https://reviews.llvm.org/D49084
More information about the llvm-commits
mailing list