16#ifndef LLVM_SUPPORT_SOURCEMGRDIAGNOSTICVERIFIER_H
17#define LLVM_SUPPORT_SOURCEMGRDIAGNOSTICVERIFIER_H
71 const Twine &msg)
const;
101 bool matchFullMessage =
false);
123 return expectedUnknownLocDiags;
140 bool reportUnexpected =
true);
153 bool matchFullMessage;
157 expectedDiagsPerBuffer;
bool hasLoc(const Instruction &I)
This file defines the DenseMap class.
This file defines the SmallVector class.
Represent a constant reference to an array (0 or more elements consecutively in memory),...
This interface provides simple read-only access to a block of memory, and provides simple methods for...
Represent a mutable reference to an array (0 or more elements consecutively in memory),...
Represents a location in source code.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
MatchResult
The result of matching a single actual diagnostic against the expected diagnostics recorded for its l...
@ Matched
The diagnostic matched an expected diagnostic (kind and text).
@ Unexpected
The diagnostic did not match any expected diagnostic.
@ Ignored
The diagnostic did not match, but reportUnexpected was false, so nothing was printed and nothing need...
@ NearMiss
The diagnostic's text matched an expected diagnostic, but its kind didn't; a message about this has a...
MutableArrayRef< ExpectedDiag > getExpectedUnknownLocDiags()
Returns the expected diagnostics with an '@unknown' location.
SourceMgrDiagnosticVerifier(const SourceMgrDiagnosticVerifier &)=delete
SourceMgrDiagnosticVerifier & operator=(const SourceMgrDiagnosticVerifier &)=delete
static void printMessage(raw_ostream &os, const SourceMgr &mgr, SMLoc loc, const Twine &msg, ArrayRef< SMRange > ranges={})
Prints an error to os without going through mgr's diagnostic handler, which may be the one feeding th...
SourceMgrDiagnosticVerifier(ArrayRef< StringRef > prefixes={"expected"}, bool matchFullMessage=false)
Recognizes directives starting with any of prefixes (e.g.
static StringRef getDiagKindStr(SourceMgr::DiagKind kind)
Given a diagnostic kind, return a human readable string for it.
This owns the files read by a parser, handles include stacks, and handles diagnostic wrangling.
Represent a constant reference to a string, i.e.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
This class implements an extremely fast bulk output stream that can only output to a stream.
bool match(Val *V, const Pattern &P)
This is an optimization pass for GlobalISel generic memory operations.
std::optional< Regex > substringRegex
An optional regex matcher, if the expected diagnostic substring was a regex string.
StringRef substring
The text that is expected to match the diagnostic message.
bool matchFullMessage
Whether the text must match the whole message instead of a substring.
ExpectedDiag(SourceMgr::DiagKind kind, unsigned lineNo, SMLoc fileLoc, StringRef substring)
unsigned numSeen
The number of matching diagnostics seen so far.
SourceMgr::DiagKind kind
The severity of the diagnostic expected.
SMLoc fileLoc
The location of the expected diagnostic within the input file.
unsigned numExpected
The number of times this diagnostic is expected.
unsigned lineNo
The line number the expected diagnostic should be on.
unsigned colNo
The column the expected diagnostic should be at, or 0 if any column matches.