LLVM 22.0.0git
llvm::StringSubstitution Class Reference

#include "FileCheck/FileCheckImpl.h"

Inheritance diagram for llvm::StringSubstitution:
[legend]

Public Member Functions

 StringSubstitution (FileCheckPatternContext *Context, StringRef VarName, 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 386 of file FileCheckImpl.h.

Constructor & Destructor Documentation

โ—† StringSubstitution()

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

Member Function Documentation

โ—† getResultForDiagnostics()

Expected< std::string > StringSubstitution::getResultForDiagnostics ( ) const
overridevirtual
Returns
the text that the string variable in this substitution matched when defined, in a form suitable for diagnostics, or an error if the variable is undefined.

Implements llvm::Substitution.

Definition at line 296 of file FileCheck.cpp.

References llvm::any_of(), llvm::CallingConv::C, llvm::Substitution::Context, llvm::Substitution::FromStr, llvm::isPrint(), llvm::Expected< T >::takeError(), and llvm::raw_ostream::write_escaped().

โ—† getResultRegex()

Expected< std::string > StringSubstitution::getResultRegex ( ) const
overridevirtual
Returns
the text that the string variable in this substitution matched when defined, or an error if the variable is undefined.

Implements llvm::Substitution.

Definition at line 288 of file FileCheck.cpp.

References llvm::Substitution::Context, llvm::Regex::escape(), llvm::Substitution::FromStr, and llvm::Expected< T >::takeError().


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