LLVM  9.0.0svn
Public Member Functions | Protected Attributes | List of all members
llvm::FileCheckSubstitution Class Referenceabstract

Class representing a substitution to perform in the RegExStr string. More...

#include "llvm/Support/FileCheck.h"

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

Public Member Functions

 FileCheckSubstitution (FileCheckPatternContext *Context, StringRef VarName, size_t InsertIdx)
 
virtual ~FileCheckSubstitution ()=default
 
StringRef getFromString () const
 
size_t getIndex () const
 
virtual Expected< std::string > getResult () const =0
 

Protected Attributes

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. More...
 
StringRef FromStr
 The string that needs to be substituted for something else. More...
 
size_t InsertIdx
 

Detailed Description

Class representing a substitution to perform in the RegExStr string.

Definition at line 185 of file FileCheck.h.

Constructor & Destructor Documentation

◆ FileCheckSubstitution()

llvm::FileCheckSubstitution::FileCheckSubstitution ( FileCheckPatternContext Context,
StringRef  VarName,
size_t  InsertIdx 
)
inline

Definition at line 203 of file FileCheck.h.

◆ ~FileCheckSubstitution()

virtual llvm::FileCheckSubstitution::~FileCheckSubstitution ( )
virtualdefault

Member Function Documentation

◆ getFromString()

StringRef llvm::FileCheckSubstitution::getFromString ( ) const
inline
Returns
the string to be substituted for something else.

Definition at line 210 of file FileCheck.h.

◆ getIndex()

size_t llvm::FileCheckSubstitution::getIndex ( ) const
inline
Returns
the index where the substitution is to be performed in RegExStr.

Definition at line 213 of file FileCheck.h.

◆ getResult()

virtual Expected<std::string> llvm::FileCheckSubstitution::getResult ( ) const
pure virtual
Returns
a string containing the result of the substitution represented by this class instance or an error if substitution failed.

Implemented in llvm::FileCheckNumericSubstitution, and llvm::FileCheckStringSubstitution.

Member Data Documentation

◆ Context

FileCheckPatternContext* llvm::FileCheckSubstitution::Context
protected

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.

Used for substituting string variables with the text they were defined as. Expressions are linked to the numeric variables they use at parse time and directly access the value of the numeric variable to evaluate their value.

Definition at line 193 of file FileCheck.h.

◆ FromStr

StringRef llvm::FileCheckSubstitution::FromStr
protected

The string that needs to be substituted for something else.

For a string variable this is its name, otherwise this is the whole expression.

Definition at line 197 of file FileCheck.h.

◆ InsertIdx

size_t llvm::FileCheckSubstitution::InsertIdx
protected

Definition at line 200 of file FileCheck.h.


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