[PATCH] D60382: FileCheck [2/12]: Stricter parsing of -D option

Thomas Preud'homme via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 7 16:17:35 PDT 2019


thopre created this revision.
thopre added reviewers: jhenderson, chandlerc, jdenny, probinson, grimar, arichardson, rnk.
Herald added a subscriber: hiraditya.
Herald added a project: LLVM.

This patch is part of a patch series to add support for FileCheck
numeric expressions. This specific patch gives earlier and better
diagnostics for the -D option.

Prior to this change, parsing of -D option was very loose: it assumed
that the part on the left of the equal sign was a valid variable name.
This commit adds logic to ensure that this is the case and gives
diagnostic when it is not, making it clear that the issue came from a
command-line option error. This is achieved by sharing the variable
parsing code into a new function ParseVariable.

Copyright:

- Linaro (changes up to diff 183612 of revision D55940 <https://reviews.llvm.org/D55940>)
- GraphCore (changes in later versions of revision D55940 <https://reviews.llvm.org/D55940> and in new revision created off D55940 <https://reviews.llvm.org/D55940>)


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D60382

Files:
  llvm/include/llvm/Support/FileCheck.h
  llvm/lib/Support/FileCheck.cpp
  llvm/test/FileCheck/defines.txt

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D60382.194077.patch
Type: text/x-patch
Size: 11264 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190407/dd9a6365/attachment.bin>


More information about the llvm-commits mailing list