[PATCH] D77227: [RFC][FileCheck] Require colon immediately after CHECK directives
Joel E. Denny via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 2 15:44:14 PDT 2020
jdenny added a comment.
In D77227#1958192 <https://reviews.llvm.org/D77227#1958192>, @jdenny wrote:
> Instead of ignoring well formed directives that don't follow the rule, maybe FileCheck should report them as errors.
I fear that was not clear. Consider this example that has a well formed directive that doesn't follow the rule:
// FIXME(201806L) CHECK: assert: 0
Approach A (from a previous comment): FileCheck executes the directive. If the user later accidentally removes the `:`, FileCheck won't execute the directive and won't diagnose the error unless the user is wiling to endure false positives by opting into the more verbose mode Paul suggested.
Approach B (from that some comment): FileCheck ignores the directive. That just makes things worse because the above otherwise well formed directive is then an undiagnosed malformed directive (unless the user opts into a more verbose mode).
Approach C (new proposal): FileCheck reports the directive as an error (in any mode). The more verbose mode is still needed to catch the case that the `:` is missing here, but at least users are guaranteed to get a slap when they write them with `:`.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D77227/new/
https://reviews.llvm.org/D77227
More information about the llvm-commits
mailing list