[PATCH] D55940: Detect incorrect FileCheck variable CLI definition
Joel E. Denny via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 21 14:05:56 PST 2018
jdenny added a comment.
In D55940#1338920 <https://reviews.llvm.org/D55940#1338920>, @thopre wrote:
> I've just given it a try but there seems to be some sorcery involved in that case: G contains just 10 instead of =10. Any way I could prevent the parsing from eating a leading equal sign? If not, I could reword the error message to mention leading equal sign but we would fail to diagnose an issue when passing -D'=Expression: VAR-5=10' typed by error instead of -D'TXT=Expression: VAR-5=10'.
I agree that command-line parsing is current set up to recognize `-D=VAR=VAL` to be the same as `-DVAR=VAL`. That doesn't seem useful.
One possible fix is to add a new member (maybe AlwaysPrefix to mean the usual `-OPT=VAL` form is never accepted) for options like this to FormattingFlags in CommandLine.h, and then adjust CommandLineParser::LookupOption to return nullptr for it.
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D55940/new/
https://reviews.llvm.org/D55940
More information about the llvm-commits
mailing list