LLVM  9.0.0svn
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)
 Reads the check file from Buffer and records the expected strings it contains in the CheckStrings vector. More...
 
bool ValidateCheckPrefixes ()
 
StringRef CanonicalizeFile (MemoryBuffer &MB, SmallVectorImpl< char > &OutputBuffer)
 Canonicalizes whitespaces in the file. More...
 
bool CheckInput (SourceMgr &SM, StringRef Buffer, ArrayRef< FileCheckString > CheckStrings, std::vector< FileCheckDiag > *Diags=nullptr)
 Checks the input to FileCheck provided in the Buffer against the CheckStrings read from the check file and record diagnostics emitted in Diags. More...
 

Detailed Description

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

Definition at line 711 of file FileCheck.h.

Constructor & Destructor Documentation

◆ FileCheck()

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

Definition at line 716 of file FileCheck.h.

Member Function Documentation

◆ buildCheckPrefixRegex()

Regex FileCheck::buildCheckPrefixRegex ( )

◆ CanonicalizeFile()

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

Canonicalizes whitespaces in the file.

Line endings are replaced with UNIX-style '
'.

Definition at line 885 of file FileCheck.cpp.

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

◆ CheckInput()

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

Checks the input to FileCheck provided in the Buffer against the CheckStrings read from the check file and record diagnostics emitted in Diags.

Errors are recorded against SM.

Returns
false if the input fails to satisfy the checks.

Definition at line 1890 of file FileCheck.cpp.

References llvm::FileCheckString::Check(), llvm::Check::CheckLabel, llvm::FileCheckPattern::getCheckTy(), llvm::StringRef::npos, llvm::FileCheckString::Pat, llvm::ArrayRef< T >::size(), and llvm::StringRef::substr().

◆ ReadCheckFile()

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

◆ ValidateCheckPrefixes()

bool FileCheck::ValidateCheckPrefixes ( )

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