LLVM  8.0.1
Public Member Functions | List of all members
llvm::FileCheck Class Reference

FileCheck class takes the request and exposes various methods that use information from the request. More...

#include "llvm/Support/FileCheck.h"

Public Member Functions

 FileCheck (FileCheckRequest Req)
 
Regex buildCheckPrefixRegex ()
 
bool ReadCheckFile (SourceMgr &SM, StringRef Buffer, Regex &PrefixRE, std::vector< FileCheckString > &CheckStrings)
 Read the check file, which specifies the sequence of expected strings. More...
 
bool ValidateCheckPrefixes ()
 
StringRef CanonicalizeFile (MemoryBuffer &MB, SmallVectorImpl< char > &OutputBuffer)
 Canonicalize whitespaces in the file. More...
 
bool CheckInput (SourceMgr &SM, StringRef Buffer, ArrayRef< FileCheckString > CheckStrings, std::vector< FileCheckDiag > *Diags=nullptr)
 Check the input to FileCheck provided in the Buffer against the CheckStrings read from the check file. More...
 

Detailed Description

FileCheck class takes the request and exposes various methods that use information from the request.

Definition at line 246 of file FileCheck.h.

Constructor & Destructor Documentation

◆ FileCheck()

llvm::FileCheck::FileCheck ( FileCheckRequest  Req)
inline

Definition at line 250 of file FileCheck.h.

Member Function Documentation

◆ buildCheckPrefixRegex()

Regex llvm::FileCheck::buildCheckPrefixRegex ( )

◆ CanonicalizeFile()

StringRef llvm::FileCheck::CanonicalizeFile ( MemoryBuffer MB,
SmallVectorImpl< char > &  OutputBuffer 
)

Canonicalize whitespaces in the file.

Line endings are replaced with UNIX-style '
'.

Definition at line 527 of file FileCheck.cpp.

References llvm::MemoryBuffer::getBufferSize(), llvm::MemoryBuffer::getBufferStart(), and llvm::SmallVectorImpl< T >::reserve().

◆ CheckInput()

bool llvm::FileCheck::CheckInput ( SourceMgr SM,
StringRef  Buffer,
ArrayRef< FileCheckString CheckStrings,
std::vector< FileCheckDiag > *  Diags = nullptr 
)

Check the input to FileCheck provided in the Buffer against the CheckStrings read from the check file.

Returns false if the input fails to satisfy the checks.

VariableTable - This holds all the current filecheck variables.

Definition at line 1383 of file FileCheck.cpp.

References llvm::FileCheckString::Check(), llvm::Check::CheckLabel, ClearLocalVars(), llvm::tgtok::Def, llvm::FileCheckPattern::getCheckTy(), llvm::StringMap< ValueTy, AllocatorTy >::insert(), llvm::StringRef::npos, llvm::FileCheckString::Pat, llvm::ArrayRef< T >::size(), split(), and llvm::StringRef::substr().

◆ ReadCheckFile()

bool llvm::FileCheck::ReadCheckFile ( SourceMgr SM,
StringRef  Buffer,
Regex PrefixRE,
std::vector< FileCheckString > &  CheckStrings 
)

◆ ValidateCheckPrefixes()

bool llvm::FileCheck::ValidateCheckPrefixes ( )

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