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 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 is then freer to evolve more independently in the way it reasons about emitted diagnostics.