Changeset View
Changeset View
Standalone View
Standalone View
llvm/lib/Support/FileCheckImpl.h
Show First 20 Lines • Show All 653 Lines • ▼ Show 20 Lines | private: | ||||
/// None. Parameter \p Context points to the class instance holding the live | /// None. Parameter \p Context points to the class instance holding the live | ||||
/// string and numeric variables. \returns the pointer to the class instance | /// string and numeric variables. \returns the pointer to the class instance | ||||
/// representing that variable if successful, or an error holding a | /// representing that variable if successful, or an error holding a | ||||
/// diagnostic against \p SM otherwise. | /// diagnostic against \p SM otherwise. | ||||
static Expected<std::unique_ptr<NumericVariableUse>> parseNumericVariableUse( | static Expected<std::unique_ptr<NumericVariableUse>> parseNumericVariableUse( | ||||
StringRef Name, bool IsPseudo, Optional<size_t> LineNumber, | StringRef Name, bool IsPseudo, Optional<size_t> LineNumber, | ||||
FileCheckPatternContext *Context, const SourceMgr &SM); | FileCheckPatternContext *Context, const SourceMgr &SM); | ||||
enum class AllowedOperand { LineVar, LegacyLiteral, Any }; | enum class AllowedOperand { LineVar, LegacyLiteral, Any }; | ||||
/// Parses \p Expr for use of a numeric operand at line \p LineNumber, or | /// Parses \p Expr for use of a numeric operand at line \p LineNumber, or | ||||
/// before input is parsed if \p LineNumber is None. Accepts both literal | /// before input is parsed if \p LineNumber is None. Accepts both literal | ||||
/// values and numeric variables, depending on the value of \p AO. Parameter | /// values and numeric variables, depending on the value of \p AO. Parameter | ||||
/// \p Context points to the class instance holding the live string and | /// \p Context points to the class instance holding the live string and | ||||
/// numeric variables. \returns the class representing that operand in the | /// numeric variables. \returns the class representing that operand in the | ||||
/// AST of the expression or an error holding a diagnostic against \p SM | /// AST of the expression or an error holding a diagnostic against \p SM | ||||
/// otherwise. | /// otherwise. If \p Expr starts with a "(" this function will attempt to | ||||
/// parse a parenthesized expression. | |||||
thopre: Maybe mentions parenthesized expression here? | |||||
Shouldn't it be \p Expr? jhenderson: Shouldn't it be `\p Expr`? | |||||
static Expected<std::unique_ptr<ExpressionAST>> | static Expected<std::unique_ptr<ExpressionAST>> | ||||
parseNumericOperand(StringRef &Expr, AllowedOperand AO, | parseNumericOperand(StringRef &Expr, AllowedOperand AO, | ||||
Optional<size_t> LineNumber, | Optional<size_t> LineNumber, | ||||
FileCheckPatternContext *Context, const SourceMgr &SM); | FileCheckPatternContext *Context, const SourceMgr &SM); | ||||
/// Parses and updates \p RemainingExpr for a binary operation at line | /// Parses and updates \p RemainingExpr for a binary operation at line | ||||
/// \p LineNumber, or before input is parsed if \p LineNumber is None. The | /// \p LineNumber, or before input is parsed if \p LineNumber is None. The | ||||
/// left operand of this binary operation is given in \p LeftOp and \p Expr | /// left operand of this binary operation is given in \p LeftOp and \p Expr | ||||
/// holds the string for the full expression, including the left operand. | /// holds the string for the full expression, including the left operand. | ||||
/// Parameter \p IsLegacyLineExpr indicates whether we are parsing a legacy | /// Parameter \p IsLegacyLineExpr indicates whether we are parsing a legacy | ||||
/// @LINE expression. Parameter \p Context points to the class instance | /// @LINE expression. Parameter \p Context points to the class instance | ||||
/// holding the live string and numeric variables. \returns the class | /// holding the live string and numeric variables. \returns the class | ||||
/// representing the binary operation in the AST of the expression, or an | /// representing the binary operation in the AST of the expression, or an | ||||
/// error holding a diagnostic against \p SM otherwise. | /// error holding a diagnostic against \p SM otherwise. | ||||
static Expected<std::unique_ptr<ExpressionAST>> | static Expected<std::unique_ptr<ExpressionAST>> | ||||
parseBinop(StringRef Expr, StringRef &RemainingExpr, | parseBinop(StringRef Expr, StringRef &RemainingExpr, | ||||
std::unique_ptr<ExpressionAST> LeftOp, bool IsLegacyLineExpr, | std::unique_ptr<ExpressionAST> LeftOp, bool IsLegacyLineExpr, | ||||
Optional<size_t> LineNumber, FileCheckPatternContext *Context, | Optional<size_t> LineNumber, FileCheckPatternContext *Context, | ||||
const SourceMgr &SM); | const SourceMgr &SM); | ||||
/// Parses a parenthesized expression inside \p Expr at line \p LineNumber, or | |||||
/// before input is parsed if \p LineNumber is None. \p Expr must start with | |||||
/// a '('. Accepts both literal values and numeric variables. Parameter \p | |||||
/// Context points to the class instance holding the live string and numeric | |||||
/// variables. \returns the class representing that operand in the AST of the | |||||
/// expression or an error holding a diagnostic against \p SM otherwise. | |||||
static Expected<std::unique_ptr<ExpressionAST>> | |||||
parseParenExpr(StringRef &Expr, Optional<size_t> LineNumber, | |||||
FileCheckPatternContext *Context, const SourceMgr &SM); | |||||
}; | }; | ||||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||||
// Check Strings. | // Check Strings. | ||||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||||
/// A check that we found in the input file. | /// A check that we found in the input file. | ||||
struct FileCheckString { | struct FileCheckString { | ||||
▲ Show 20 Lines • Show All 44 Lines • Show Last 20 Lines |
Maybe mentions parenthesized expression here?