[all-commits] [llvm/llvm-project] 4becd0: [FileCheck][NFC] Introduce FileCheckDiagList for -...
Joel E. Denny via All-commits
all-commits at lists.llvm.org
Wed May 6 07:18:16 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 4becd0c44b01a83e172fd28c1b3a3b8dd598f3fc
https://github.com/llvm/llvm-project/commit/4becd0c44b01a83e172fd28c1b3a3b8dd598f3fc
Author: Joel E. Denny <jdenny.ornl at gmail.com>
Date: 2026-05-06 (Wed, 06 May 2026)
Changed paths:
M llvm/include/llvm/FileCheck/FileCheck.h
M llvm/lib/FileCheck/FileCheck.cpp
M llvm/lib/FileCheck/FileCheckImpl.h
M llvm/unittests/FileCheck/FileCheckTest.cpp
M llvm/utils/FileCheck/FileCheck.cpp
Log Message:
-----------
[FileCheck][NFC] Introduce FileCheckDiagList for -dump-input (#195568)
Problem
=======
`FileCheckDiag` and its `enum MatchType` have outgrown their original
purpose. The `-dump-input` presentation layer (in
`llvm/utils/FileCheck/FileCheck.cpp`) and the FileCheck library's
diagnostic emission (in `llvm/lib/FileCheck/FileCheck.cpp`) are too
tightly coupled. The interactions are subtle to understand and maintain.
It is difficult for the former to reason about the latter's emitted
diagnostics in order to present them in the most readable manner.
Solution
========
This patch is the first in an NFC series that removes `MatchType` from
`FileCheckDiag` and refactors `FileCheckDiag` as the base class of a
class hierarchy. That class hierarchy is designed to enable the
FileCheck library to focus on communicating FileCheck diagnostic
information clearly and completely without participating in the specific
presentation decisions of `-dump-input`. `-dump-input` and any future
diagnostic presentation layer that FileCheck might grow are then freer
to evolve more independently in the way they reason about emitted
diagnostics. Moreover, the hierarchy enables various `FileCheckDiag`
objects not to carry various data not needed for the diagnostics they
describe.
This Patch
==========
The main goal of this particular patch is to introduce the
`FileCheckDiagList` class and to separate mostly mechanical changes from
future patches to make them more readable. However, by itself, it does
offer some small improvements: it encapsulates the `adjustPrevDiags`
functionality, and it replaces the cryptic `ProcessMatchResult` function
with more readable code.
Why now?
========
FileCheck's input dumps have usability issues, including confusing
verbosity and the need to look in the test file to see directive
patterns. There has been a recent push in issue #77257 and in PRs linked
from there to address these issues. This patch series is a first step in
the most recent strategy discussed there. Actually, it is an older
strategy that was started in
[D126673](https://reviews.llvm.org/D126673) but never completed. The
current patch series updates D126673 and splits it apart to facilitate
the review. The actual usability improvements are implemented by patches
that build on this series.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list