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