LLVM 18.0.0git
|
A check that we found in the input file. More...
#include "FileCheck/FileCheckImpl.h"
Public Member Functions | |
FileCheckString (const Pattern &P, StringRef S, SMLoc L) | |
size_t | Check (const SourceMgr &SM, StringRef Buffer, bool IsLabelScanMode, size_t &MatchLen, FileCheckRequest &Req, std::vector< FileCheckDiag > *Diags) const |
Matches check string and its "not strings" and/or "dag strings". | |
bool | CheckNext (const SourceMgr &SM, StringRef Buffer) const |
Verifies that there is a single line in the given Buffer . | |
bool | CheckSame (const SourceMgr &SM, StringRef Buffer) const |
Verifies that there is no newline in the given Buffer . | |
bool | CheckNot (const SourceMgr &SM, StringRef Buffer, const std::vector< const Pattern * > &NotStrings, const FileCheckRequest &Req, std::vector< FileCheckDiag > *Diags) const |
Verifies that none of the strings in NotStrings are found in the given Buffer . | |
size_t | CheckDag (const SourceMgr &SM, StringRef Buffer, std::vector< const Pattern * > &NotStrings, const FileCheckRequest &Req, std::vector< FileCheckDiag > *Diags) const |
Matches "dag strings" and their mixed "not strings". | |
Public Attributes | |
Pattern | Pat |
The pattern to match. | |
StringRef | Prefix |
Which prefix name this check matched. | |
SMLoc | Loc |
The location in the match file that the check string was specified. | |
std::vector< Pattern > | DagNotStrings |
All of the strings that are disallowed from occurring between this match string and the previous one (or start of file). | |
A check that we found in the input file.
Definition at line 816 of file FileCheckImpl.h.
Definition at line 830 of file FileCheckImpl.h.
size_t FileCheckString::Check | ( | const SourceMgr & | SM, |
StringRef | Buffer, | ||
bool | IsLabelScanMode, | ||
size_t & | MatchLen, | ||
FileCheckRequest & | Req, | ||
std::vector< FileCheckDiag > * | Diags | ||
) | const |
Matches check string and its "not strings" and/or "dag strings".
Definition at line 2163 of file FileCheck.cpp.
References assert(), llvm::cantFail(), CheckDag(), CheckNext(), CheckNot(), CheckSame(), E, llvm::Pattern::getCheckTy(), llvm::Pattern::getCount(), llvm::handleErrors(), Loc, llvm::Pattern::match(), llvm::FileCheckDiag::MatchFoundButWrongLine, llvm::StringRef::npos, Pat, Prefix, ProcessMatchResult(), reportMatchResult(), llvm::StringRef::substr(), llvm::Pattern::MatchResult::TheMatch, and llvm::FileCheckRequest::Verbose.
Referenced by llvm::FileCheck::checkInput().
size_t FileCheckString::CheckDag | ( | const SourceMgr & | SM, |
StringRef | Buffer, | ||
std::vector< const Pattern * > & | NotStrings, | ||
const FileCheckRequest & | Req, | ||
std::vector< FileCheckDiag > * | Diags | ||
) | const |
Matches "dag strings" and their mixed "not strings".
Definition at line 2324 of file FileCheck.cpp.
References llvm::FileCheckRequest::AllowDeprecatedDagOverlap, assert(), llvm::Block, llvm::cantFail(), llvm::Check::CheckDAG, llvm::Check::CheckNot, CheckNot(), DagNotStrings, llvm::StringRef::data(), llvm::SourceMgr::DK_Note, E, End, llvm::Pattern::getCheckTy(), llvm::SMLoc::getFromPointer(), llvm::Pattern::getLoc(), llvm::handleErrors(), I, llvm::Pattern::match(), llvm::FileCheckDiag::MatchFoundButDiscarded, MI, llvm::StringRef::npos, Pat, Prefix, printMatch(), llvm::SourceMgr::PrintMessage(), reportMatchResult(), llvm::StringRef::slice(), llvm::StringRef::substr(), llvm::Error::success(), llvm::Pattern::MatchResult::TheError, llvm::Pattern::MatchResult::TheMatch, and llvm::FileCheckRequest::VerboseVerbose.
Referenced by Check().
Verifies that there is a single line in the given Buffer
.
Errors are reported against SM
.
Definition at line 2244 of file FileCheck.cpp.
References llvm::Check::CheckEmpty, llvm::Check::CheckNext, CountNumNewlinesBetween(), llvm::StringRef::data(), llvm::SourceMgr::DK_Error, llvm::SourceMgr::DK_Note, llvm::StringRef::end(), llvm::Pattern::getCheckTy(), llvm::SMLoc::getFromPointer(), Loc, Pat, Prefix, and llvm::SourceMgr::PrintMessage().
Referenced by Check().
bool FileCheckString::CheckNot | ( | const SourceMgr & | SM, |
StringRef | Buffer, | ||
const std::vector< const Pattern * > & | NotStrings, | ||
const FileCheckRequest & | Req, | ||
std::vector< FileCheckDiag > * | Diags | ||
) | const |
Verifies that none of the strings in NotStrings
are found in the given Buffer
.
Errors are reported against SM
and diagnostics recorded in Diags
according to the verbosity level set in Req
.
Definition at line 2305 of file FileCheck.cpp.
References assert(), llvm::cantFail(), llvm::Check::CheckNot, E, llvm::Pattern::getCheckTy(), llvm::Pattern::getLoc(), llvm::handleErrors(), llvm::Pattern::match(), Pat, Prefix, and reportMatchResult().
Referenced by Check(), and CheckDag().
Verifies that there is no newline in the given Buffer
.
Errors are reported against SM
.
Definition at line 2283 of file FileCheck.cpp.
References llvm::Check::CheckSame, CountNumNewlinesBetween(), llvm::StringRef::data(), llvm::SourceMgr::DK_Error, llvm::SourceMgr::DK_Note, llvm::StringRef::end(), llvm::Pattern::getCheckTy(), llvm::SMLoc::getFromPointer(), Loc, Pat, Prefix, and llvm::SourceMgr::PrintMessage().
Referenced by Check().
std::vector<Pattern> llvm::FileCheckString::DagNotStrings |
All of the strings that are disallowed from occurring between this match string and the previous one (or start of file).
Definition at line 828 of file FileCheckImpl.h.
Referenced by CheckDag().
SMLoc llvm::FileCheckString::Loc |
The location in the match file that the check string was specified.
Definition at line 824 of file FileCheckImpl.h.
Referenced by Check(), CheckNext(), and CheckSame().
Pattern llvm::FileCheckString::Pat |
The pattern to match.
Definition at line 818 of file FileCheckImpl.h.
Referenced by Check(), CheckDag(), llvm::FileCheck::checkInput(), CheckNext(), CheckNot(), and CheckSame().
StringRef llvm::FileCheckString::Prefix |
Which prefix name this check matched.
Definition at line 821 of file FileCheckImpl.h.
Referenced by Check(), CheckDag(), CheckNext(), CheckNot(), and CheckSame().