LLVM  10.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 "Support/FileCheckImpl.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 173 of file FileCheckImpl.h.

Constructor & Destructor Documentation

◆ FileCheckSubstitution()

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

Definition at line 191 of file FileCheckImpl.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 198 of file FileCheckImpl.h.

◆ getIndex()

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

Definition at line 201 of file FileCheckImpl.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 181 of file FileCheckImpl.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 185 of file FileCheckImpl.h.

◆ InsertIdx

size_t llvm::FileCheckSubstitution::InsertIdx
protected

Definition at line 188 of file FileCheckImpl.h.


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