LLVM 22.0.0git
llvm::NumericSubstitution Class Reference

#include "FileCheck/FileCheckImpl.h"

Inheritance diagram for llvm::NumericSubstitution:
[legend]

Public Member Functions

 NumericSubstitution (FileCheckPatternContext *Context, StringRef ExpressionStr, std::unique_ptr< Expression > ExpressionPointer, size_t InsertIdx)
Expected< std::string > getResultRegex () const override
Expected< std::string > getResultForDiagnostics () const override
Public Member Functions inherited from llvm::Substitution
 Substitution (FileCheckPatternContext *Context, StringRef VarName, size_t InsertIdx)
virtual ~Substitution ()=default
StringRef getFromString () const
size_t getIndex () const

Additional Inherited Members

Protected Attributes inherited from llvm::Substitution
FileCheckPatternContextContext
 Pointer to a class instance holding, among other things, the table with the values of live string variables at the start of any given CHECK line.
StringRef FromStr
 The string that needs to be substituted for something else.
size_t InsertIdx

Detailed Description

Definition at line 402 of file FileCheckImpl.h.

Constructor & Destructor Documentation

◆ NumericSubstitution()

llvm::NumericSubstitution::NumericSubstitution ( FileCheckPatternContext * Context,
StringRef ExpressionStr,
std::unique_ptr< Expression > ExpressionPointer,
size_t InsertIdx )
inline

Member Function Documentation

◆ getResultForDiagnostics()

Expected< std::string > NumericSubstitution::getResultForDiagnostics ( ) const
overridevirtual
Returns
a string containing the result of evaluating the expression in this substitution, in a form suitable for diagnostics, or an error if evaluation failed.

Implements llvm::Substitution.

Definition at line 277 of file FileCheck.cpp.

References getResultRegex(), and llvm::Literal.

◆ getResultRegex()

Expected< std::string > NumericSubstitution::getResultRegex ( ) const
overridevirtual
Returns
a string containing the result of evaluating the expression in this substitution, or an error if evaluation failed.

Implements llvm::Substitution.

Definition at line 267 of file FileCheck.cpp.

References assert(), llvm::Format, and llvm::Expected< T >::takeError().

Referenced by getResultForDiagnostics().


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