LLVM: include/llvm/FileCheck/FileCheck.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13#ifndef LLVM_FILECHECK_FILECHECK_H
14#define LLVM_FILECHECK_FILECHECK_H
15
19#include
20#include
21#include
22#include
23
24namespace llvm {
25class MemoryBuffer;
26class SourceMgr;
27template class SmallVectorImpl;
28
29
45};
46
48
60
61
62
64
65
67
68
71
73
75
76
79
82 int Count;
83
84 std::bitsetFileCheckKindModifier::Size Modifiers;
85
86public:
90
92
93 int getCount() const { return Count; }
95
98 }
101 return *this;
102 }
103
104
106
107
109};
110}
111
112
114
116
118
119
120
121
122
123
124
125
126
127
128
129
131
133
135
136
138
140
141
142
143
144
146
148
149
150
152
153
154
155
157
158
161
162
167
168
173};
174
177
178
179
182 std::unique_ptr PatternContext;
183 std::vector CheckStrings;
184
185public:
188
189
190
191
192
193
194
195 bool
197 std::pair<unsigned, unsigned> *ImpPatBufferIDRange = nullptr);
198
200
201
202
205
206
207
208
209
210
212 std::vector *Diags = nullptr);
213};
214
215}
216
217#endif
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.