LLVM 20.0.0git
|
Class representing a single binary operation in the AST of an expression. More...
#include "FileCheck/FileCheckImpl.h"
Public Member Functions | |
BinaryOperation (StringRef ExpressionStr, binop_eval_t EvalBinop, std::unique_ptr< ExpressionAST > LeftOp, std::unique_ptr< ExpressionAST > RightOp) | |
Expected< APInt > | eval () const override |
Evaluates the value of the binary operation represented by this AST, using EvalBinop on the result of recursively evaluating the operands. | |
Expected< ExpressionFormat > | getImplicitFormat (const SourceMgr &SM) const override |
Public Member Functions inherited from llvm::ExpressionAST | |
ExpressionAST (StringRef ExpressionStr) | |
virtual | ~ExpressionAST ()=default |
StringRef | getExpressionStr () const |
virtual Expected< APInt > | eval () const =0 |
Evaluates and. | |
virtual Expected< ExpressionFormat > | getImplicitFormat (const SourceMgr &SM) const |
Class representing a single binary operation in the AST of an expression.
Definition at line 302 of file FileCheckImpl.h.
|
inline |
Definition at line 314 of file FileCheckImpl.h.
Evaluates the value of the binary operation represented by this AST, using EvalBinop on the result of recursively evaluating the operands.
Implements llvm::ExpressionAST.
Definition at line 203 of file FileCheck.cpp.
References llvm::APInt::getBitWidth(), llvm::joinErrors(), nextAPIntBitWidth(), llvm::APInt::sext(), llvm::Error::success(), and llvm::Expected< T >::takeError().
|
overridevirtual |
SM
if the implicit formats of the AST's components conflict, or no format if the AST has no implicit format (e.g. AST is made of a single literal). Reimplemented from llvm::ExpressionAST.
Definition at line 242 of file FileCheck.cpp.
References llvm::ErrorDiagnostic::get(), llvm::ExpressionAST::getExpressionStr(), llvm::joinErrors(), llvm::ExpressionFormat::NoFormat, llvm::Error::success(), and llvm::Expected< T >::takeError().