LLVM 20.0.0git
Public Types | Public Member Functions | Public Attributes | List of all members
llvm::FileCheckDiag Struct Reference

Summary of a FileCheck diagnostic. More...

#include "llvm/FileCheck/FileCheck.h"

Public Types

enum  MatchType {
  MatchFoundAndExpected , MatchFoundButExcluded , MatchFoundButWrongLine , MatchFoundButDiscarded ,
  MatchFoundErrorNote , MatchNoneAndExcluded , MatchNoneButExpected , MatchNoneForInvalidPattern ,
  MatchFuzzy
}
 What type of match result does this diagnostic describe? More...
 

Public Member Functions

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

Public Attributes

Check::FileCheckType CheckTy
 What is the FileCheck directive for this diagnostic?
 
SMLoc CheckLoc
 Where is the FileCheck directive for this diagnostic?
 
enum llvm::FileCheckDiag::MatchType MatchTy
 
unsigned InputStartLine
 The search range if MatchTy starts with MatchNone, or the match range otherwise.
 
unsigned InputStartCol
 
unsigned InputEndLine
 
unsigned InputEndCol
 
std::string Note
 A note to replace the one normally indicated by MatchTy, or the empty string if none.
 

Detailed Description

Summary of a FileCheck diagnostic.

Definition at line 113 of file FileCheck.h.

Member Enumeration Documentation

◆ MatchType

What type of match result does this diagnostic describe?

A directive's supplied pattern is said to be either expected or excluded depending on whether the pattern must have or must not have a match in order for the directive to succeed. For example, a CHECK directive's pattern is expected, and a CHECK-NOT directive's pattern is excluded.

There might be more than one match result for a single pattern. For example, there might be several discarded matches (MatchFoundButDiscarded) before either a good match (MatchFoundAndExpected) or a failure to match (MatchNoneButExpected), and there might be a fuzzy match (MatchFuzzy) after the latter.

Enumerator
MatchFoundAndExpected 

Indicates a good match for an expected pattern.

MatchFoundButExcluded 

Indicates a match for an excluded pattern.

MatchFoundButWrongLine 

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

MatchFoundButDiscarded 

Indicates a discarded match for an expected pattern.

MatchFoundErrorNote 

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

The error is specified by Note, to which it should be appropriate to prepend "error: " later. The full match itself should be recorded in a preceding diagnostic of a different MatchFound match type.

MatchNoneAndExcluded 

Indicates no match for an excluded pattern.

MatchNoneButExpected 

Indicates no match for an expected pattern, but this might follow good matches when multiple matches are expected for the pattern, or it might follow discarded matches for the pattern.

MatchNoneForInvalidPattern 

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

The exact problems are usually reported in subsequent diagnostics of the same match type but with Note set.

MatchFuzzy 

Indicates a fuzzy match that serves as a suggestion for the next intended match for an expected pattern with too few or no good matches.

Definition at line 130 of file FileCheck.h.

Constructor & Destructor Documentation

◆ FileCheckDiag()

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

Member Data Documentation

◆ CheckLoc

SMLoc llvm::FileCheckDiag::CheckLoc

Where is the FileCheck directive for this diagnostic?

Definition at line 117 of file FileCheck.h.

◆ CheckTy

Check::FileCheckType llvm::FileCheckDiag::CheckTy

What is the FileCheck directive for this diagnostic?

Definition at line 115 of file FileCheck.h.

◆ InputEndCol

unsigned llvm::FileCheckDiag::InputEndCol

Definition at line 166 of file FileCheck.h.

Referenced by FileCheckDiag().

◆ InputEndLine

unsigned llvm::FileCheckDiag::InputEndLine

Definition at line 165 of file FileCheck.h.

Referenced by FileCheckDiag().

◆ InputStartCol

unsigned llvm::FileCheckDiag::InputStartCol

Definition at line 164 of file FileCheck.h.

Referenced by FileCheckDiag().

◆ InputStartLine

unsigned llvm::FileCheckDiag::InputStartLine

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

Definition at line 163 of file FileCheck.h.

Referenced by FileCheckDiag().

◆ MatchTy

enum llvm::FileCheckDiag::MatchType llvm::FileCheckDiag::MatchTy

◆ Note

std::string llvm::FileCheckDiag::Note

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

Definition at line 169 of file FileCheck.h.


The documentation for this struct was generated from the following files: