class BinaryOperation

Declaration

class BinaryOperation : public ExpressionAST { /* full declaration omitted */ };

Description

Class representing a single binary operation in the AST of an expression.

Declared at: llvm/lib/FileCheck/FileCheckImpl.h:351

Inherits from: ExpressionAST

Member Variables

private std::unique_ptr<ExpressionAST> LeftOperand
Left operand.
private std::unique_ptr<ExpressionAST> RightOperand
Right operand.
private llvm::binop_eval_t EvalBinop
Pointer to function that can evaluate this binary operation.

Method Overview

  • public BinaryOperation(llvm::StringRef ExpressionStr, llvm::binop_eval_t EvalBinop, std::unique_ptr<ExpressionAST> LeftOp, std::unique_ptr<ExpressionAST> RightOp)
  • public Expected<llvm::ExpressionValue> eval() const
  • public Expected<llvm::ExpressionFormat> getImplicitFormat(const llvm::SourceMgr & SM) const

Inherited from ExpressionAST:

Methods

BinaryOperation(
    llvm::StringRef ExpressionStr,
    llvm::binop_eval_t EvalBinop,
    std::unique_ptr<ExpressionAST> LeftOp,
    std::unique_ptr<ExpressionAST> RightOp)

Declared at: llvm/lib/FileCheck/FileCheckImpl.h:363

Parameters

llvm::StringRef ExpressionStr
llvm::binop_eval_t EvalBinop
std::unique_ptr<ExpressionAST> LeftOp
std::unique_ptr<ExpressionAST> RightOp

Expected<llvm::ExpressionValue> eval() const

Description

Evaluates the value of the binary operation represented by this AST, using EvalBinop on the result of recursively evaluating the operands.

Declared at: llvm/lib/FileCheck/FileCheckImpl.h:375

Returns

the expression value or an error if an undefined numeric variable is used in one of the operands.

Expected<llvm::ExpressionFormat>
getImplicitFormat(const llvm::SourceMgr& SM) const

Declared at: llvm/lib/FileCheck/FileCheckImpl.h:382

Parameters

const llvm::SourceMgr& SM

Returns

the implicit format of this AST, if any, a diagnostic against\p 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).