|
LLVM 23.0.0git
|
Abstract base class for recording a FileCheck diagnostic for a pattern (e.g., CHECK-NEXT directive or --implicit-check-not).
More...
#include "llvm/FileCheck/FileCheck.h"
Public Types | |
| enum | FileCheckDiagKind { MatchResultDiag_First , MatchFoundDiag = MatchResultDiag_First , MatchNoneDiag , MatchResultDiag_Last = MatchNoneDiag , MatchNoteDiag_First , MatchFuzzyDiag = MatchNoteDiag_First , MatchCustomNoteDiag , MatchNoteDiag_Last = MatchCustomNoteDiag } |
Public Member Functions | |
| FileCheckDiag (FileCheckDiagKind Kind) | |
| virtual | ~FileCheckDiag ()=0 |
| Destructor is purely virtual to ensure this remains an abstract class. | |
| FileCheckDiagKind | getKind () const |
| Of what derived class is this an instance? | |
| virtual const MatchResultDiag & | getMatchResultDiag () const =0 |
If this is a MatchResultDiag, return itself. | |
| virtual bool | isError () const =0 |
| Does this diagnostic reveal a new error? | |
| virtual std::optional< SMRange > | getMatchRange () const =0 |
Return the input range for which this diagnostic indicates text that was matched in some way (e.g., successful pattern match, discarded pattern match, or variable capture), or return std::nullopt if the diagnostic has no such input range. | |
Abstract base class for recording a FileCheck diagnostic for a pattern (e.g., CHECK-NEXT directive or --implicit-check-not).
FileCheckDiag has two direct derived classes:
MatchResultDiag records a match result for a pattern. There might be more than one for a single pattern. For example, for CHECK-DAG there might be several discarded matches before either a good match or a failure to match.MatchNoteDiag provides an additional note about the most recent MatchResultDiag emitted by a FileCheck invocation. For example, there might be a fuzzy match after a failure to match.Throughout this class hierarchy, a pattern is said to be either expected or excluded depending on whether the pattern must have or must not have a match in order for it to succeed. For example, a CHECK directive's pattern is expected, and a CHECK-NOT directive's pattern is excluded.
Definition at line 133 of file FileCheck.h.
| Enumerator | |
|---|---|
| MatchResultDiag_First | |
| MatchFoundDiag | |
| MatchNoneDiag | |
| MatchResultDiag_Last | |
| MatchNoteDiag_First | |
| MatchFuzzyDiag | |
| MatchCustomNoteDiag | |
| MatchNoteDiag_Last | |
Definition at line 135 of file FileCheck.h.
|
inline |
Definition at line 152 of file FileCheck.h.
Referenced by llvm::MatchNoteDiag::classof(), llvm::MatchResultDiag::classof(), llvm::MatchNoteDiag::MatchNoteDiag(), and llvm::MatchResultDiag::MatchResultDiag().
|
pure virtual |
Destructor is purely virtual to ensure this remains an abstract class.
Definition at line 1507 of file FileCheck.cpp.
|
inline |
Of what derived class is this an instance?
Definition at line 156 of file FileCheck.h.
Referenced by llvm::MatchCustomNoteDiag::classof(), llvm::MatchFoundDiag::classof(), llvm::MatchFuzzyDiag::classof(), llvm::MatchNoneDiag::classof(), llvm::MatchNoteDiag::classof(), and llvm::MatchResultDiag::classof().
|
pure virtual |
Return the input range for which this diagnostic indicates text that was matched in some way (e.g., successful pattern match, discarded pattern match, or variable capture), or return std::nullopt if the diagnostic has no such input range.
Implemented in llvm::MatchCustomNoteDiag, llvm::MatchFoundDiag, llvm::MatchFuzzyDiag, and llvm::MatchNoneDiag.
|
pure virtual |
If this is a MatchResultDiag, return itself.
If this is a MatchNoteDiag, return its associated MatchResultDiag.
Implemented in llvm::MatchNoteDiag, and llvm::MatchResultDiag.
|
pure virtual |
Does this diagnostic reveal a new error?
For MatchResultDiag, !isError() is not always the same as a successful pattern match result. For MatchNoteDiag, !isError() does not indicate the lack of an error but rather the lack of an additional error beyond its associated MatchResultDiag. See documentation on derived types for details.
Implemented in llvm::MatchCustomNoteDiag, llvm::MatchFoundDiag, llvm::MatchFuzzyDiag, and llvm::MatchNoneDiag.