MLIR
20.0.0git
|
This class represents an expected output diagnostic. More...
Public Member Functions | |
ExpectedDiag (DiagnosticSeverity kind, unsigned lineNo, SMLoc fileLoc, StringRef substring) | |
LogicalResult | emitError (raw_ostream &os, llvm::SourceMgr &mgr, const Twine &msg) |
Emit an error at the location referenced by this diagnostic. More... | |
bool | match (StringRef str) const |
Returns true if this diagnostic matches the given string. More... | |
LogicalResult | computeRegex (raw_ostream &os, llvm::SourceMgr &mgr) |
Compute the regex matcher for this diagnostic, using the provided stream and manager to emit diagnostics as necessary. More... | |
Public Attributes | |
DiagnosticSeverity | kind |
The severity of the diagnosic expected. More... | |
unsigned | lineNo |
The line number the expected diagnostic should be on. More... | |
SMLoc | fileLoc |
The location of the expected diagnostic within the input file. More... | |
bool | matched = false |
A flag indicating if the expected diagnostic has been matched yet. More... | |
StringRef | substring |
The substring that is expected to be within the diagnostic. More... | |
std::optional< llvm::Regex > | substringRegex |
An optional regex matcher, if the expected diagnostic sub-string was a regex string. More... | |
This class represents an expected output diagnostic.
Definition at line 587 of file Diagnostics.cpp.
|
inline |
Definition at line 588 of file Diagnostics.cpp.
|
inline |
Compute the regex matcher for this diagnostic, using the provided stream and manager to emit diagnostics as necessary.
Definition at line 612 of file Diagnostics.cpp.
References emitError(), substring, and substringRegex.
|
inline |
Emit an error at the location referenced by this diagnostic.
Definition at line 593 of file Diagnostics.cpp.
References fileLoc, and substring.
Referenced by computeRegex().
|
inline |
Returns true if this diagnostic matches the given string.
Definition at line 602 of file Diagnostics.cpp.
References substring, and substringRegex.
SMLoc mlir::detail::ExpectedDiag::fileLoc |
The location of the expected diagnostic within the input file.
Definition at line 649 of file Diagnostics.cpp.
Referenced by emitError().
DiagnosticSeverity mlir::detail::ExpectedDiag::kind |
The severity of the diagnosic expected.
Definition at line 645 of file Diagnostics.cpp.
unsigned mlir::detail::ExpectedDiag::lineNo |
The line number the expected diagnostic should be on.
Definition at line 647 of file Diagnostics.cpp.
bool mlir::detail::ExpectedDiag::matched = false |
A flag indicating if the expected diagnostic has been matched yet.
Definition at line 651 of file Diagnostics.cpp.
StringRef mlir::detail::ExpectedDiag::substring |
The substring that is expected to be within the diagnostic.
Definition at line 653 of file Diagnostics.cpp.
Referenced by computeRegex(), emitError(), and match().
std::optional<llvm::Regex> mlir::detail::ExpectedDiag::substringRegex |
An optional regex matcher, if the expected diagnostic sub-string was a regex string.
Definition at line 656 of file Diagnostics.cpp.
Referenced by computeRegex(), and match().