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

20#include

21#include

22#include

23#include

24

25namespace llvm {

29

30

47

49

61

62

63

65

66

68

69

71};

72

80

83 int Count;

84

85 std::bitsetFileCheckKindModifier::Size Modifiers;

86

87public:

91

93

94 int getCount() const { return Count; }

96

104

105

107

108

110};

111}

112

113

115

117

119

120

121

122

123

124

125

126

127

128

129

130

132

134

136

137

139

141

142

143

144

145

147

149

150

151

153

154

155

156

158

159

161 } MatchTy;

162

163

168

169

175};

176

179

180

181

184 std::unique_ptr PatternContext;

185 std::vector CheckStrings;

186

187public:

190

191

192

193

194

195

196

199 std::pair<unsigned, unsigned> *ImpPatBufferIDRange = nullptr);

200

202

203

204

207

208

209

210

211

212

214 std::vector *Diags = nullptr);

215};

216

217}

218

219#endif

Definition FileCheck.h:81

LLVM_ABI std::string getDescription(StringRef Prefix) const

FileCheckType(FileCheckKind Kind=CheckNone)

Definition FileCheck.h:88

int getCount() const

Definition FileCheck.h:94

FileCheckType & operator=(const FileCheckType &)=default

bool isLiteralMatch() const

Definition FileCheck.h:97

LLVM_ABI std::string getModifiersDescription() const

FileCheckType & setLiteralMatch(bool Literal=true)

Definition FileCheck.h:100

LLVM_ABI FileCheckType & setCount(int C)

FileCheckType(const FileCheckType &)=default

Class holding the Pattern global state, shared by all patterns: tables holding values of variables an...

LLVM_ABI 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.

LLVM_ABI StringRef CanonicalizeFile(MemoryBuffer &MB, SmallVectorImpl< char > &OutputBuffer)

Canonicalizes whitespaces in the file.

LLVM_ABI FileCheck(FileCheckRequest Req)

LLVM_ABI 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...

LLVM_ABI 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.

Definition FileCheck.h:48

FileCheckKindModifier

Definition FileCheck.h:73

@ Size

Definition FileCheck.h:78

@ ModifierLiteral

Modifies directive to perform literal match.

Definition FileCheck.h:75

FileCheckKind

Definition FileCheck.h:50

@ CheckPlain

Definition FileCheck.h:53

@ CheckNext

Definition FileCheck.h:54

@ CheckNot

Definition FileCheck.h:56

@ CheckDAG

Definition FileCheck.h:57

@ CheckEmpty

Definition FileCheck.h:59

@ CheckBadNot

Marks when parsing found a -NOT check combined with another CHECK suffix.

Definition FileCheck.h:67

@ CheckNone

Definition FileCheck.h:51

@ CheckBadCount

Marks when parsing found a -COUNT directive with invalid count value.

Definition FileCheck.h:70

@ CheckEOF

Indicates the pattern only matches the end of file.

Definition FileCheck.h:64

@ CheckMisspelled

Definition FileCheck.h:52

@ CheckLabel

Definition FileCheck.h:58

@ CheckComment

Definition FileCheck.h:60

@ CheckSame

Definition FileCheck.h:55

This is an optimization pass for GlobalISel generic memory operations.

std::string Note

A note to replace the one normally indicated by MatchTy, or the empty string if none.

Definition FileCheck.h:170

unsigned InputStartCol

Definition FileCheck.h:165

enum llvm::FileCheckDiag::MatchType MatchTy

unsigned InputStartLine

The search range if MatchTy starts with MatchNone, or the match range otherwise.

Definition FileCheck.h:164

unsigned InputEndLine

Definition FileCheck.h:166

LLVM_ABI FileCheckDiag(const SourceMgr &SM, const Check::FileCheckType &CheckTy, SMLoc CheckLoc, MatchType MatchTy, SMRange InputRange, StringRef Note="")

Check::FileCheckType CheckTy

What is the FileCheck directive for this diagnostic?

Definition FileCheck.h:116

unsigned InputEndCol

Definition FileCheck.h:167

MatchType

What type of match result does this diagnostic describe?

Definition FileCheck.h:131

@ MatchFoundButWrongLine

Indicates a match for an expected pattern, but the match is on the wrong line.

Definition FileCheck.h:138

@ MatchNoneAndExcluded

Indicates no match for an excluded pattern.

Definition FileCheck.h:148

@ MatchFoundButExcluded

Indicates a match for an excluded pattern.

Definition FileCheck.h:135

@ MatchFuzzy

Indicates a fuzzy match that serves as a suggestion for the next intended match for an expected patte...

Definition FileCheck.h:160

@ MatchFoundErrorNote

Indicates an error while processing a match after the match was found for an expected or excluded pat...

Definition FileCheck.h:146

@ MatchFoundButDiscarded

Indicates a discarded match for an expected pattern.

Definition FileCheck.h:140

@ MatchNoneForInvalidPattern

Indicates no match due to an expected or excluded pattern that has proven to be invalid at match time...

Definition FileCheck.h:157

@ MatchFoundAndExpected

Indicates a good match for an expected pattern.

Definition FileCheck.h:133

@ MatchNoneButExpected

Indicates no match for an expected pattern, but this might follow good matches when multiple matches ...

Definition FileCheck.h:152

SMLoc CheckLoc

Where is the FileCheck directive for this diagnostic?

Definition FileCheck.h:118

Contains info about various FileCheck options.

Definition FileCheck.h:31

bool EnableVarScope

Definition FileCheck.h:42

bool IsDefaultCheckPrefix

Definition FileCheck.h:41

bool VerboseVerbose

Definition FileCheck.h:45

std::vector< StringRef > GlobalDefines

Definition FileCheck.h:36

bool NoCanonicalizeWhiteSpace

Definition FileCheck.h:34

std::vector< StringRef > ImplicitCheckNot

Definition FileCheck.h:35

bool MatchFullLines

Definition FileCheck.h:39

bool Verbose

Definition FileCheck.h:44

std::vector< StringRef > CommentPrefixes

Definition FileCheck.h:33

bool AllowUnusedPrefixes

Definition FileCheck.h:38

std::vector< StringRef > CheckPrefixes

Definition FileCheck.h:32

bool AllowDeprecatedDagOverlap

Definition FileCheck.h:43

bool IgnoreCase

Definition FileCheck.h:40

bool AllowEmptyInput

Definition FileCheck.h:37

A check that we found in the input file.