LLVM 23.0.0git
llvm::MatchCustomNoteDiag Class Reference

MatchNoteDiag with a custom note not described by any other class derived from MatchNoteDiag. More...

#include "llvm/FileCheck/FileCheck.h"

Inheritance diagram for llvm::MatchCustomNoteDiag:
[legend]

Public Member Functions

const std::string & getNote () const
bool isError () const override
 Does this note indicate an additional error not indicated by the associated MatchResultDiag?
std::optional< SMRangegetMatchRange () const override
 Return the match range described by the note, or std::nullopt if none.
 MatchCustomNoteDiag (SMRange MatchRange, StringRef Note, bool AddsError=false)
 If MatchRange is specified, it is a range for input text that was matched in some way (e.g., variable capture) and that is described by this note.
 MatchCustomNoteDiag (StringRef Note)
Public Member Functions inherited from llvm::MatchNoteDiag
 MatchNoteDiag (FileCheckDiagKind Kind)
virtual ~MatchNoteDiag ()=0
 Destructor is purely virtual to ensure this remains an abstract class.
const MatchResultDiaggetMatchResultDiag () const override
 Get the note's associated MatchResultDiag.
void setMatchResultDiag (MatchResultDiag *MRDNew)
 Set the note's associated MatchResultDiag.
Public Member Functions inherited from llvm::FileCheckDiag
 FileCheckDiag (FileCheckDiagKind Kind)
virtual ~FileCheckDiag ()=0
 Destructor is purely virtual to ensure this remains an abstract class.
FileCheckDiagKind getKind () const
 Of what derived class is this an instance?

Static Public Member Functions

static bool classof (const FileCheckDiag *FCD)
 Is FCD an instance of MatchCustomNoteDiag?
Static Public Member Functions inherited from llvm::MatchNoteDiag
static bool classof (const FileCheckDiag *FCD)
 Is FCD an instance of MatchNoteDiag?

Additional Inherited Members

Public Types inherited from llvm::FileCheckDiag
enum  FileCheckDiagKind {
  MatchResultDiag_First , MatchFoundDiag = MatchResultDiag_First , MatchNoneDiag , MatchResultDiag_Last = MatchNoneDiag ,
  MatchNoteDiag_First , MatchFuzzyDiag = MatchNoteDiag_First , MatchCustomNoteDiag , MatchNoteDiag_Last = MatchCustomNoteDiag
}

Detailed Description

MatchNoteDiag with a custom note not described by any other class derived from MatchNoteDiag.

Definition at line 350 of file FileCheck.h.

Constructor & Destructor Documentation

◆ MatchCustomNoteDiag() [1/2]

llvm::MatchCustomNoteDiag::MatchCustomNoteDiag ( SMRange MatchRange,
StringRef Note,
bool AddsError = false )
inline

If MatchRange is specified, it is a range for input text that was matched in some way (e.g., variable capture) and that is described by this note.

Either way, as usual, the associated MatchResultDiag has any full match range for the pattern.

If AddsError is true, then this note indicates a new error that is distinct from any error indicated by the associated MatchResultDiag. The error is described by Note, which must be worded appropriately for prepending "error: " when presented later. For example, the associated MatchResultDiag might indicate a match to either an expected pattern (success) or an excluded pattern (error), and Note might be "unable to represent numeric value" to indicate the match could not be processed afterward.

If AddsError is false, then this note merely provides additional information about the associated MatchResultDiag. That information might be something harmless (e.g., variable substitution), or it might be one of potentially many problems summarized as an error by the MatchResultDiag (e.g., one way in which the pattern was invalid).

Definition at line 377 of file FileCheck.h.

References MatchCustomNoteDiag(), and llvm::MatchNoteDiag::MatchNoteDiag().

Referenced by MatchCustomNoteDiag(), and MatchCustomNoteDiag().

◆ MatchCustomNoteDiag() [2/2]

llvm::MatchCustomNoteDiag::MatchCustomNoteDiag ( StringRef Note)
inline

Definition at line 381 of file FileCheck.h.

References MatchCustomNoteDiag(), and llvm::MatchNoteDiag::MatchNoteDiag().

Member Function Documentation

◆ classof()

bool llvm::MatchCustomNoteDiag::classof ( const FileCheckDiag * FCD)
inlinestatic

Is FCD an instance of MatchCustomNoteDiag?

Definition at line 386 of file FileCheck.h.

References llvm::FileCheckDiag::getKind(), and llvm::FileCheckDiag::MatchCustomNoteDiag.

◆ getMatchRange()

std::optional< SMRange > llvm::MatchCustomNoteDiag::getMatchRange ( ) const
inlineoverridevirtual

Return the match range described by the note, or std::nullopt if none.

Implements llvm::FileCheckDiag.

Definition at line 397 of file FileCheck.h.

◆ getNote()

const std::string & llvm::MatchCustomNoteDiag::getNote ( ) const
inline

Definition at line 389 of file FileCheck.h.

◆ isError()

bool llvm::MatchCustomNoteDiag::isError ( ) const
inlineoverridevirtual

Does this note indicate an additional error not indicated by the associated MatchResultDiag?

For details, see the MatchCustomNoteDiag::MatchCustomNoteDiag comments for its AddsError parameter.

Implements llvm::FileCheckDiag.

Definition at line 395 of file FileCheck.h.


The documentation for this class was generated from the following file: