13#ifndef LLVM_FILECHECK_FILECHECK_H
14#define LLVM_FILECHECK_FILECHECK_H
27template <
typename T>
class SmallVectorImpl;
84 std::bitset<FileCheckKindModifier::Size> Modifiers;
182 std::unique_ptr<FileCheckPatternContext> PatternContext;
184 std::unique_ptr<std::vector<FileCheckString>> CheckStrings;
198 std::pair<unsigned, unsigned> *ImpPatBufferIDRange =
nullptr);
213 std::vector<FileCheckDiag> *Diags =
nullptr);
std::string getDescription(StringRef Prefix) const
FileCheckType(FileCheckKind Kind=CheckNone)
FileCheckType & operator=(const FileCheckType &)=default
bool isLiteralMatch() const
std::string getModifiersDescription() const
FileCheckType & setLiteralMatch(bool Literal=true)
FileCheckType & setCount(int C)
FileCheckType(const FileCheckType &)=default
Class holding the Pattern global state, shared by all patterns: tables holding values of variables an...
FileCheck class takes the request and exposes various methods that use information from the request.
bool readCheckFile(SourceMgr &SM, StringRef Buffer, std::pair< unsigned, unsigned > *ImpPatBufferIDRange=nullptr)
Reads the check file from Buffer and records the expected strings it contains.
StringRef CanonicalizeFile(MemoryBuffer &MB, SmallVectorImpl< char > &OutputBuffer)
Canonicalizes whitespaces in the file.
bool checkInput(SourceMgr &SM, StringRef Buffer, std::vector< FileCheckDiag > *Diags=nullptr)
Checks the input to FileCheck provided in the Buffer against the expected strings read from the check...
bool ValidateCheckPrefixes()
This interface provides simple read-only access to a block of memory, and provides simple methods for...
Represents a location in source code.
Represents a range in source code.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
This owns the files read by a parser, handles include stacks, and handles diagnostic wrangling.
StringRef - Represent a constant reference to a string, i.e.
@ C
The default llvm calling convention, compatible with C.
@ ModifierLiteral
Modifies directive to perform literal match.
@ CheckBadNot
Marks when parsing found a -NOT check combined with another CHECK suffix.
@ CheckBadCount
Marks when parsing found a -COUNT directive with invalid count value.
@ CheckEOF
Indicates the pattern only matches the end of file.
This is an optimization pass for GlobalISel generic memory operations.
Summary of a FileCheck diagnostic.
std::string Note
A note to replace the one normally indicated by MatchTy, or the empty string if none.
enum llvm::FileCheckDiag::MatchType MatchTy
unsigned InputStartLine
The search range if MatchTy starts with MatchNone, or the match range otherwise.
Check::FileCheckType CheckTy
What is the FileCheck directive for this diagnostic?
MatchType
What type of match result does this diagnostic describe?
@ MatchFoundButWrongLine
Indicates a match for an expected pattern, but the match is on the wrong line.
@ MatchNoneAndExcluded
Indicates no match for an excluded pattern.
@ MatchFoundButExcluded
Indicates a match for an excluded pattern.
@ MatchFuzzy
Indicates a fuzzy match that serves as a suggestion for the next intended match for an expected patte...
@ MatchFoundErrorNote
Indicates an error while processing a match after the match was found for an expected or excluded pat...
@ MatchFoundButDiscarded
Indicates a discarded match for an expected pattern.
@ MatchNoneForInvalidPattern
Indicates no match due to an expected or excluded pattern that has proven to be invalid at match time...
@ MatchFoundAndExpected
Indicates a good match for an expected pattern.
@ MatchNoneButExpected
Indicates no match for an expected pattern, but this might follow good matches when multiple matches ...
SMLoc CheckLoc
Where is the FileCheck directive for this diagnostic?
Contains info about various FileCheck options.
bool IsDefaultCheckPrefix
std::vector< StringRef > GlobalDefines
bool NoCanonicalizeWhiteSpace
std::vector< StringRef > ImplicitCheckNot
std::vector< StringRef > CommentPrefixes
std::vector< StringRef > CheckPrefixes
bool AllowDeprecatedDagOverlap
A check that we found in the input file.