LLVM  14.0.0git
Public Member Functions | Friends | List of all members
llvm::FileCheckPatternContext Class Reference

Class holding the Pattern global state, shared by all patterns: tables holding values of variables and whether they are defined or not at any given time in the matching process. More...

#include "FileCheck/FileCheckImpl.h"

Public Member Functions

Expected< StringRefgetPatternVarValue (StringRef VarName)
 
Error defineCmdlineVariables (ArrayRef< StringRef > CmdlineDefines, SourceMgr &SM)
 Defines string and numeric variables from definitions given on the command line, passed as a vector of [#]VAR=VAL strings in CmdlineDefines. More...
 
void createLineVariable ()
 Create @LINE pseudo variable. More...
 
void clearLocalVars ()
 Undefines local variables (variables whose name does not start with a '$' sign), i.e. More...
 

Friends

class Pattern
 

Detailed Description

Class holding the Pattern global state, shared by all patterns: tables holding values of variables and whether they are defined or not at any given time in the matching process.

Definition at line 459 of file FileCheckImpl.h.

Member Function Documentation

◆ clearLocalVars()

void llvm::FileCheckPatternContext::clearLocalVars ( )

Undefines local variables (variables whose name does not start with a '$' sign), i.e.

removes them from GlobalVariableTable and from GlobalNumericVariableTable and also clears the value of numeric variables.

◆ createLineVariable()

void llvm::FileCheckPatternContext::createLineVariable ( )

Create @LINE pseudo variable.

Value is set when pattern are being matched.

◆ defineCmdlineVariables()

Error llvm::FileCheckPatternContext::defineCmdlineVariables ( ArrayRef< StringRef CmdlineDefines,
SourceMgr SM 
)

Defines string and numeric variables from definitions given on the command line, passed as a vector of [#]VAR=VAL strings in CmdlineDefines.

Returns
an error list containing diagnostics against SM for all definition parsing failures, if any, or Success otherwise.

◆ getPatternVarValue()

Expected<StringRef> llvm::FileCheckPatternContext::getPatternVarValue ( StringRef  VarName)
Returns
the value of string variable VarName or an error if no such variable has been defined.

Referenced by llvm::StringSubstitution::getResult().

Friends And Related Function Documentation

◆ Pattern

friend class Pattern
friend

Definition at line 460 of file FileCheckImpl.h.


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