class Substitution

Declaration

class Substitution { /* full declaration omitted */ };

Description

Class representing a substitution to perform in the RegExStr string.

Declared at: llvm/lib/FileCheck/FileCheckImpl.h:388

Member Variables

protected llvm::FileCheckPatternContext* Context
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.
protected llvm::StringRef FromStr
The string that needs to be substituted for something else. For a string variable this is its name, otherwise this is the whole expression.
protected size_t InsertIdx

Method Overview

Methods

Substitution(
    llvm::FileCheckPatternContext* Context,
    llvm::StringRef VarName,
    size_t InsertIdx)

Declared at: llvm/lib/FileCheck/FileCheckImpl.h:406

Parameters

llvm::FileCheckPatternContext* Context
llvm::StringRef VarName
size_t InsertIdx

llvm::StringRef getFromString() const

Declared at: llvm/lib/FileCheck/FileCheckImpl.h:413

Returns

the string to be substituted for something else.

size_t getIndex() const

Declared at: llvm/lib/FileCheck/FileCheckImpl.h:416

Returns

the index where the substitution is to be performed in RegExStr.

virtual Expected<std::string> getResult() const

Declared at: llvm/lib/FileCheck/FileCheckImpl.h:420

Returns

a string containing the result of the substitution represented by this class instance or an error if substitution failed.

virtual ~Substitution()

Declared at: llvm/lib/FileCheck/FileCheckImpl.h:410