LLVM 19.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< APInteval () const =0
 Evaluates and.
 
virtual Expected< ExpressionFormatgetImplicitFormat (const SourceMgr &SM) const
 

Detailed Description

Base class representing the AST of a given expression.

Definition at line 126 of file FileCheckImpl.h.

Constructor & Destructor Documentation

◆ ExpressionAST()

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

Definition at line 131 of file FileCheckImpl.h.

◆ ~ExpressionAST()

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

Member Function Documentation

◆ eval()

virtual Expected< APInt > 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::ExpressionLiteral, llvm::NumericVariableUse, and llvm::BinaryOperation.

Referenced by llvm::FileCheckPatternContext::defineCmdlineVariables().

◆ getExpressionStr()

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

◆ 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::NumericVariableUse, and llvm::BinaryOperation.

Definition at line 146 of file FileCheckImpl.h.


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