[PATCH] D66141: [FileCheck] Forbid using var defined on same line
Thomas Preud'homme via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 13 07:24:29 PDT 2019
thopre created this revision.
thopre added reviewers: jhenderson, chandlerc, jdenny, probinson, grimar, arichardson, rnk.
thopre added a project: LLVM.
Commit r366897 introduced the possibility to set a variable from an
expression, such as #VAR2:VAR1+3. While introducing this feature, it
introduced extra logic to allow using such a variable on the same line
later on. Unfortunately that extra logic is flawed as it relies on a
mapping from variable to expression defining it when the mapping is from
variable definition to expression. This flaw causes among other issues
PR42896.
This commit avoids the problem by forbidding all use of a variable
defined on the same line, and removes the now useless logic. Redesign
will be done in a later commit because it will require some amount of
refactoring first for the solution to be clean. One example is the need
for some sort of transaction mechanism to set a variable temporarily and
from an expression and rollback if the CHECK pattern does not match so
that diagnostics show the right variable values.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D66141
Files:
llvm/include/llvm/Support/FileCheck.h
llvm/lib/Support/FileCheck.cpp
llvm/test/FileCheck/numeric-expression.txt
llvm/unittests/Support/FileCheckTest.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D66141.214832.patch
Type: text/x-patch
Size: 10858 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190813/de98b121/attachment-0001.bin>
More information about the llvm-commits
mailing list