16#ifndef LLVM_SUPPORT_SOURCEMGRDIAGNOSTICVERIFIER_H
17#define LLVM_SUPPORT_SOURCEMGRDIAGNOSTICVERIFIER_H
71 const Twine &msg)
const;
101 std::optional<MutableArrayRef<ExpectedDiag>>
106 return expectedUnknownLocDiags;
121 StringRef message,
bool reportUnexpected =
true);
This file defines the StringMap class.
bool hasLoc(const Instruction &I)
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(ArrayRef< StringRef > prefixes={ "expected"})
Recognizes directives starting with any of prefixes (e.g.
This owns the files read by a parser, handles include stacks, and handles diagnostic wrangling.
StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...
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 substring that is expected to be within the diagnostic.
ExpectedDiag(SourceMgr::DiagKind kind, unsigned lineNo, SMLoc fileLoc, StringRef substring)
SourceMgr::DiagKind kind
The severity of the diagnostic expected.
SMLoc fileLoc
The location of the expected diagnostic within the input file.
unsigned lineNo
The line number the expected diagnostic should be on.
bool matched
A flag indicating if the expected diagnostic has been matched yet.