LLVM
8.0.1
|
#include "llvm/Support/FileCheck.h"
Public Member Functions | |
FileCheckPattern (Check::FileCheckType Ty) | |
SMLoc | getLoc () const |
Returns the location in source code. More... | |
bool | ParsePattern (StringRef PatternStr, StringRef Prefix, SourceMgr &SM, unsigned LineNumber, const FileCheckRequest &Req) |
Parses the given string into the Pattern. More... | |
size_t | Match (StringRef Buffer, size_t &MatchLen, StringMap< StringRef > &VariableTable) const |
Matches the pattern string against the input buffer Buffer . More... | |
void | PrintVariableUses (const SourceMgr &SM, StringRef Buffer, const StringMap< StringRef > &VariableTable, SMRange MatchRange=None) const |
void | PrintFuzzyMatch (const SourceMgr &SM, StringRef Buffer, const StringMap< StringRef > &VariableTable, std::vector< FileCheckDiag > *Diags) const |
bool | hasVariable () const |
Check::FileCheckType | getCheckTy () const |
int | getCount () const |
Definition at line 87 of file FileCheck.h.
|
inlineexplicit |
Definition at line 116 of file FileCheck.h.
|
inline |
Definition at line 137 of file FileCheck.h.
Referenced by llvm::FileCheck::CheckInput(), PrintFuzzyMatch(), PrintMatch(), and PrintNoMatch().
|
inline |
Definition at line 139 of file FileCheck.h.
References EvaluateExpression(), and llvm::Check::FileCheckType::getCount().
Referenced by PrintMatch(), and PrintNoMatch().
|
inline |
Returns the location in source code.
Definition at line 120 of file FileCheck.h.
References llvm::Match, llvm::None, and llvm::cl::Prefix.
Referenced by PrintFuzzyMatch().
|
inline |
Definition at line 133 of file FileCheck.h.
size_t FileCheckPattern::Match | ( | StringRef | Buffer, |
size_t & | MatchLen, | ||
StringMap< StringRef > & | VariableTable | ||
) | const |
Matches the pattern string against the input buffer Buffer
.
This returns the position that is matched or npos if there is no match. If there is a match, the size of the matched string is returned in MatchLen
.
The VariableTable
StringMap provides the current values of filecheck variables and is updated if this match defines new values.
Definition at line 275 of file FileCheck.cpp.
References assert(), llvm::Check::CheckEmpty, llvm::Check::CheckEOF, llvm::StringRef::data(), llvm::StringRef::edit_distance(), llvm::SmallVectorBase::empty(), llvm::StringRef::empty(), llvm::StringMap< ValueTy, AllocatorTy >::end(), llvm::Regex::escape(), llvm::StringRef::find(), llvm::StringMap< ValueTy, AllocatorTy >::find(), llvm::PatternMatch::match(), llvm::Regex::Newline, llvm::StringRef::npos, llvm::SmallVectorBase::size(), llvm::StringRef::size(), llvm::StringRef::split(), and llvm::StringRef::substr().
bool FileCheckPattern::ParsePattern | ( | StringRef | PatternStr, |
StringRef | Prefix, | ||
SourceMgr & | SM, | ||
unsigned | LineNumber, | ||
const FileCheckRequest & | Req | ||
) |
Parses the given string into the Pattern.
Prefix
provides which prefix is being matched, SM
provides the SourceMgr used for error reports, and LineNumber
is the line number in the input file from which the pattern string was read. Returns true in case of an error, false otherwise.
Definition at line 34 of file FileCheck.cpp.
References llvm::StringRef::back(), llvm::Check::CheckEmpty, llvm::Check::CheckNot, llvm::StringRef::data(), llvm::SourceMgr::DK_Error, llvm::StringRef::empty(), llvm::StringRef::find(), llvm::SMLoc::getFromPointer(), llvm::FileCheckRequest::MatchFullLines, llvm::FileCheckRequest::NoCanonicalizeWhiteSpace, llvm::StringRef::npos, llvm::SourceMgr::PrintMessage(), llvm::StringRef::size(), llvm::StringRef::startswith(), and llvm::StringRef::substr().
void FileCheckPattern::PrintFuzzyMatch | ( | const SourceMgr & | SM, |
StringRef | Buffer, | ||
const StringMap< StringRef > & | VariableTable, | ||
std::vector< FileCheckDiag > * | Diags | ||
) | const |
Definition at line 433 of file FileCheck.cpp.
References llvm::StringRef::data(), llvm::SourceMgr::DK_Error, llvm::SourceMgr::DK_Note, llvm::StringRef::empty(), getCheckTy(), llvm::SMLoc::getFromPointer(), getLoc(), llvm::FileCheckDiag::MatchFuzzy, llvm::StringRef::npos, llvm::SourceMgr::PrintMessage(), ProcessMatchResult(), llvm::StringRef::size(), llvm::SMRange::Start, llvm::StringRef::startswith(), and llvm::StringRef::substr().
Referenced by PrintNoMatch().
void FileCheckPattern::PrintVariableUses | ( | const SourceMgr & | SM, |
StringRef | Buffer, | ||
const StringMap< StringRef > & | VariableTable, | ||
SMRange | MatchRange = None |
||
) | const |
Definition at line 371 of file FileCheck.cpp.
References llvm::StringRef::data(), llvm::SourceMgr::DK_Note, llvm::StringMap< ValueTy, AllocatorTy >::end(), llvm::StringMap< ValueTy, AllocatorTy >::find(), llvm::SMLoc::getFromPointer(), llvm::SMRange::isValid(), llvm::SourceMgr::PrintMessage(), llvm::SMRange::Start, llvm::raw_svector_ostream::str(), and llvm::raw_ostream::write_escaped().
Referenced by PrintMatch(), and PrintNoMatch().