LLVM  10.0.0svn
Public Member Functions | Friends | List of all members
llvm::FileCheckPatternContext Class Reference

Class holding the FileCheckPattern 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 "Support/FileCheckImpl.h"

Public Member Functions

Expected< StringRefgetPatternVarValue (StringRef VarName)
 
Error defineCmdlineVariables (std::vector< std::string > &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 pseudo variable. More...
 
void clearLocalVars ()
 Undefines local variables (variables whose name does not start with a '$' sign), i.e. More...
 

Friends

class FileCheckPattern
 

Detailed Description

Class holding the FileCheckPattern 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 247 of file FileCheckImpl.h.

Member Function Documentation

◆ clearLocalVars()

void 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.

Definition at line 1907 of file FileCheck.cpp.

References llvm::SmallVectorTemplateBase< T >::push_back().

◆ createLineVariable()

void FileCheckPatternContext::createLineVariable ( )

Create pseudo variable.

Value is set when pattern are being matched.

Definition at line 1118 of file FileCheck.cpp.

References assert().

◆ defineCmdlineVariables()

Error FileCheckPatternContext::defineCmdlineVariables ( std::vector< std::string > &  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.

Definition at line 1768 of file FileCheck.cpp.

References llvm::SourceMgr::AddNewSourceBuffer(), assert(), llvm::StringRef::empty(), llvm::FileCheckErrorDiagnostic::get(), llvm::MemoryBuffer::getMemBufferCopy(), I, llvm::joinErrors(), Name, llvm::None, llvm::StringRef::npos, llvm::FileCheckPattern::parseNumericSubstitutionBlock(), llvm::FileCheckPattern::parseVariable(), llvm::SmallVectorTemplateBase< T >::push_back(), llvm::StringRef::split(), llvm::StringRef::substr(), llvm::Error::success(), and llvm::Expected< T >::takeError().

◆ getPatternVarValue()

Expected< StringRef > FileCheckPatternContext::getPatternVarValue ( StringRef  VarName)

Friends And Related Function Documentation

◆ FileCheckPattern

friend class FileCheckPattern
friend

Definition at line 248 of file FileCheckImpl.h.


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