[PATCH] D150880: Allow AP value for numeric expressions

Thomas Preud'homme via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 18 09:17:10 PDT 2023


thopre created this revision.
thopre added reviewers: jdenny, jhenderson, probinson, arichardson, grimar.
Herald added a subscriber: hiraditya.
Herald added a project: All.
thopre requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Use APInt to represent numeric variables and expressions, therefore
removing overflow concerns. Only remains underflow when the format of an
expression is unsigned (incl. hex values) but the result is negative.
Note that this can only happen when substituting an expression, not when
capturing, hence all the code removal for match propagation testing.
This is what this patch implement.

As for the RFC, I do wonder if it makes sense to keep the %u specifier.
What I have in mind is to allow hex values to be negative which means
all values can be represented. If going down that route, what does the
precision means for negative values? Does it include the sign character?

Depends on D150797 <https://reviews.llvm.org/D150797> and D150878 <https://reviews.llvm.org/D150878> and D150879 <https://reviews.llvm.org/D150879>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D150880

Files:
  llvm/lib/FileCheck/FileCheck.cpp
  llvm/lib/FileCheck/FileCheckImpl.h
  llvm/test/FileCheck/match-time-error-propagation/invalid-excluded-pattern.txt
  llvm/test/FileCheck/match-time-error-propagation/invalid-expected-pattern.txt
  llvm/test/FileCheck/match-time-error-propagation/matched-excluded-pattern.txt
  llvm/test/FileCheck/match-time-error-propagation/matched-expected-pattern.txt
  llvm/test/FileCheck/numeric-expression.txt
  llvm/unittests/FileCheck/FileCheckTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D150880.523407.patch
Type: text/x-patch
Size: 77931 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230518/a6986d2f/attachment-0001.bin>


More information about the llvm-commits mailing list