[PATCH] D96653: [FileCheck] Add neighboring annotations for -dump-input-filter=error

Thomas Preud'homme via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 15 03:36:55 PST 2021


thopre added inline comments.


================
Comment at: llvm/test/FileCheck/dump-input/filter-error-neighbor/multiline.txt:1-11
+; -dump-input-filter=error reveals only the first or last line of an annotation
+; neighboring an error, depending on whether it precedes or follows the error.
+; This test checks that we don't mix up first and last.  Otherwise, a preceding
+; or following annotation can accidentally be omitted altogether.  Of course,
+; we must have multiline annotations so that first != last.
+;
+; This test also checks that CHECK-LABEL is handled in the same way.  That is,
----------------
Could you do like the other tests and explain what input lines are revealed by this code?


================
Comment at: llvm/utils/FileCheck/FileCheck.cpp:158-160
                           "Input lines with starting points of error "
+                          "annotations or with annotations that neighbor error "
                           "annotations")));
----------------
Isn't there one too many "annotations" in that sentence?


================
Comment at: llvm/utils/FileCheck/FileCheck.cpp:517-518
+      // before the last line of an error, include it.  A CHECK-LABEL directive
+      // is processed before all other directives, so its annotation precedes
+      // the last line of an error that precedes it.  Don't apply that exception
+      // generally, or a CHECK-DAG error can produce a spurious inclusion due to
----------------
Is this saying that for a LABEL match ending at line L, the annotation for an error on line L-1 would be after the annotation for the LABEL match end at line L? Or is the "that precedes it" redundant and this is just saying that in the case of an error end and a LABEL end on line L, the label is first?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D96653



More information about the llvm-commits mailing list