LLVM  14.0.0git
Public Member Functions | List of all members
llvm::ExpressionAST Class Referenceabstract

Base class representing the AST of a given expression. More...

#include "FileCheck/FileCheckImpl.h"

Inheritance diagram for llvm::ExpressionAST:
Inheritance graph
[legend]

Public Member Functions

 ExpressionAST (StringRef ExpressionStr)
 
virtual ~ExpressionAST ()=default
 
StringRef getExpressionStr () const
 
virtual Expected< ExpressionValueeval () const =0
 Evaluates and. More...
 
virtual Expected< ExpressionFormatgetImplicitFormat (const SourceMgr &SM) const
 

Detailed Description

Base class representing the AST of a given expression.

Definition at line 173 of file FileCheckImpl.h.

Constructor & Destructor Documentation

◆ ExpressionAST()

llvm::ExpressionAST::ExpressionAST ( StringRef  ExpressionStr)
inline

Definition at line 178 of file FileCheckImpl.h.

◆ ~ExpressionAST()

virtual llvm::ExpressionAST::~ExpressionAST ( )
virtualdefault

Member Function Documentation

◆ eval()

virtual Expected<ExpressionValue> llvm::ExpressionAST::eval ( ) const
pure virtual

Evaluates and.

Returns
the value of the expression represented by this AST or an error if evaluation fails.

Implemented in llvm::BinaryOperation, llvm::NumericVariableUse, and llvm::ExpressionLiteral.

◆ getExpressionStr()

StringRef llvm::ExpressionAST::getExpressionStr ( ) const
inline

Definition at line 182 of file FileCheckImpl.h.

Referenced by llvm::NumericVariableUse::eval().

◆ getImplicitFormat()

virtual Expected<ExpressionFormat> llvm::ExpressionAST::getImplicitFormat ( const SourceMgr SM) const
inlinevirtual
Returns
either the implicit format of this AST, a diagnostic against SM if implicit formats of the AST's components conflict, or NoFormat if the AST has no implicit format (e.g. AST is made up of a single literal).

Reimplemented in llvm::BinaryOperation, and llvm::NumericVariableUse.

Definition at line 193 of file FileCheckImpl.h.


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