LLVM  13.0.0git
Public Member Functions | List of all members
llvm::BinaryOperation Class Reference

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

#include "FileCheck/FileCheckImpl.h"

Inheritance diagram for llvm::BinaryOperation:
Inheritance graph
[legend]
Collaboration diagram for llvm::BinaryOperation:
Collaboration graph
[legend]

Public Member Functions

 BinaryOperation (StringRef ExpressionStr, binop_eval_t EvalBinop, std::unique_ptr< ExpressionAST > LeftOp, std::unique_ptr< ExpressionAST > RightOp)
 
Expected< ExpressionValueeval () const override
 Evaluates the value of the binary operation represented by this AST, using EvalBinop on the result of recursively evaluating the operands. More...
 
Expected< ExpressionFormatgetImplicitFormat (const SourceMgr &SM) const override
 
- Public Member Functions inherited from llvm::ExpressionAST
 ExpressionAST (StringRef ExpressionStr)
 
virtual ~ExpressionAST ()=default
 
StringRef getExpressionStr () const
 

Detailed Description

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

Definition at line 351 of file FileCheckImpl.h.

Constructor & Destructor Documentation

◆ BinaryOperation()

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

Definition at line 363 of file FileCheckImpl.h.

References move.

Member Function Documentation

◆ eval()

Expected< ExpressionValue > BinaryOperation::eval ( ) const
overridevirtual

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

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

Implements llvm::ExpressionAST.

Definition at line 373 of file FileCheck.cpp.

◆ getImplicitFormat()

Expected< ExpressionFormat > BinaryOperation::getImplicitFormat ( const SourceMgr SM) const
overridevirtual
Returns
the implicit format of this AST, if any, a diagnostic against 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 392 of file FileCheck.cpp.


The documentation for this class was generated from the following files: