[PATCH] D53898: [FileCheck] Annotate input dump (6/7)

Joel E. Denny via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 3 14:14:14 PST 2018


jdenny added a comment.

In D53898#1317412 <https://reviews.llvm.org/D53898#1317412>, @probinson wrote:

> You're using `!~~~` to flag: (a) CHECK-NOT that has a match, (b) CHECK-NEXT that isn't in the right place, (c) a discarded DAG match.


Right.  `^~~` means a match that is good, `!~~` means a match that is bad, and `X~~` means no match found.

A bad match or a lack of a match is not always an error.  A bad match might be discarded, in the case of CHECK-DAG.  A lack of a match is desirable in the case of CHECK-NOT.

> The first two are errors (which would be reported regardless of annotations) but the third is not.

Colors (when enabled) indicate what happens to the match: green for good, cyan for discarded, and red for error.

If you don't have colors, you can currently tell from the directive name whether `!~~` or `X~~` is an error.  I can't promise that would hold true as FileCheck evolves new features, so color might become more important then.

>   So, I'm not sure why it should have the same kind of annotation.

I'm open to suggestions for a better scheme.

One possibility is to merge all `^~~` and `!~~` cases into just `^~~`, so then `^~~` means any match found (whether good or bad) and `X~~` means no match found.  But that seems less helpful, especially when there's no color.

Another possibility is to split the discarded CHECK-DAG case from `!~~` so that `!~~` just means a bad match that produces an error.  What should the new marker for a discarded match be?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D53898/new/

https://reviews.llvm.org/D53898





More information about the llvm-commits mailing list