LLVM
15.0.0git
|
#include "FileCheck/FileCheckImpl.h"
Classes | |
struct | Match |
struct | MatchResult |
struct | VariableProperties |
Parsing information about a variable. More... | |
Static Public Member Functions | |
static bool | isValidVarNameStart (char C) |
static Expected< VariableProperties > | parseVariable (StringRef &Str, const SourceMgr &SM) |
Parses the string at the start of Str for a variable name. More... | |
static Expected< std::unique_ptr< Expression > > | parseNumericSubstitutionBlock (StringRef Expr, Optional< NumericVariable * > &DefinedNumericVariable, bool IsLegacyLineExpr, Optional< size_t > LineNumber, FileCheckPatternContext *Context, const SourceMgr &SM) |
Parses Expr for a numeric substitution block at line LineNumber , or before input is parsed if LineNumber is None. More... | |
Definition at line 614 of file FileCheckImpl.h.
|
inline |
Definition at line 684 of file FileCheckImpl.h.
References Context.
|
inline |
Definition at line 771 of file FileCheckImpl.h.
|
inline |
Definition at line 693 of file FileCheckImpl.h.
References Context.
|
inline |
Definition at line 773 of file FileCheckImpl.h.
References llvm::Check::FileCheckType::getCount().
|
inline |
Definition at line 689 of file FileCheckImpl.h.
|
inline |
Definition at line 765 of file FileCheckImpl.h.
|
static |
C
is a valid first character for a variable name. Definition at line 437 of file FileCheck.cpp.
Referenced by parseVariable().
MatchResult llvm::Pattern::match | ( | StringRef | Buffer, |
const SourceMgr & | SM | ||
) | const |
Matches the pattern string against the input buffer Buffer
.
The GlobalVariableTable StringMap in the FileCheckPatternContext class instance provides the current values of FileCheck string variables and is updated if this match defines new values. Likewise, the GlobalNumericVariableTable StringMap in the same class provides the current values of FileCheck numeric variables and is updated if this match defines new numeric values.
Referenced by llvm::ifs::filterIFSSyms().
|
static |
Parses Expr
for a numeric substitution block at line LineNumber
, or before input is parsed if LineNumber
is None.
Parameter IsLegacyLineExpr
indicates whether Expr
should be a legacy @LINE expression and Context
points to the class instance holding the live string and numeric variables.
SM
if parsing fails. If substitution was successful, sets DefinedNumericVariable
to point to the class representing the numeric variable defined in this numeric substitution block, or None if this block does not define any variable. Definition at line 767 of file FileCheck.cpp.
References llvm::StringRef::consume_front(), llvm::StringRef::consumeInteger(), Context, llvm::StringRef::data(), llvm::StringRef::drop_front(), llvm::StringRef::empty(), llvm::StringRef::find(), llvm::ErrorDiagnostic::get(), llvm::SMLoc::getFromPointer(), llvm::ExpressionFormat::HexLower, llvm::ExpressionFormat::HexUpper, llvm::StringRef::ltrim(), move, llvm::None, llvm::StringRef::npos, popFront(), llvm::StringRef::rtrim(), llvm::ExpressionFormat::Signed, SpaceChars, llvm::StringRef::substr(), llvm::StringRef::take_front(), llvm::Expected< T >::takeError(), llvm::StringRef::trim(), and llvm::ExpressionFormat::Unsigned.
bool Pattern::parsePattern | ( | StringRef | PatternStr, |
StringRef | Prefix, | ||
SourceMgr & | SM, | ||
const FileCheckRequest & | Req | ||
) |
Parses the pattern in PatternStr
and initializes this Pattern instance accordingly.
Prefix
provides which prefix is being matched, Req
describes the global options that influence the parsing such as whitespace canonicalization, SM
provides the SourceMgr used for error reports.
Definition at line 916 of file FileCheck.cpp.
References llvm::StringRef::back(), llvm::Check::CheckEmpty, llvm::Check::CheckNot, llvm::StringRef::contains(), llvm::StringRef::data(), llvm::SourceMgr::DK_Error, llvm::StringRef::empty(), llvm::SMLoc::getFromPointer(), llvm::FileCheckRequest::IgnoreCase, llvm::Check::FileCheckType::isLiteralMatch(), llvm::FileCheckRequest::MatchFullLines, llvm::FileCheckRequest::NoCanonicalizeWhiteSpace, llvm::cl::Prefix, llvm::SourceMgr::PrintMessage(), llvm::StringRef::size(), llvm::StringRef::startswith(), and llvm::StringRef::substr().
|
static |
Parses the string at the start of Str
for a variable name.
SM
if parsing fail. If parsing was successful, also strips Str
from the variable name. Definition at line 440 of file FileCheck.cpp.
References E, llvm::ErrorDiagnostic::get(), I, and isValidVarNameStart().
void llvm::Pattern::printFuzzyMatch | ( | const SourceMgr & | SM, |
StringRef | Buffer, | ||
std::vector< FileCheckDiag > * | Diags | ||
) | const |
void llvm::Pattern::printSubstitutions | ( | const SourceMgr & | SM, |
StringRef | Buffer, | ||
SMRange | MatchRange, | ||
FileCheckDiag::MatchType | MatchTy, | ||
std::vector< FileCheckDiag > * | Diags | ||
) | const |
Prints the value of successful substitutions.
void llvm::Pattern::printVariableDefs | ( | const SourceMgr & | SM, |
FileCheckDiag::MatchType | MatchTy, | ||
std::vector< FileCheckDiag > * | Diags | ||
) | const |