LLVM  10.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)
 
 ~FileCheck ()
 
Regex buildCheckPrefixRegex ()
 
bool readCheckFile (SourceMgr &SM, StringRef Buffer, Regex &PrefixRE)
 Reads the check file from Buffer and records the expected strings it contains. More...
 
bool ValidateCheckPrefixes ()
 
StringRef CanonicalizeFile (MemoryBuffer &MB, SmallVectorImpl< char > &OutputBuffer)
 Canonicalizes whitespaces in the file. More...
 
bool checkInput (SourceMgr &SM, StringRef Buffer, std::vector< FileCheckDiag > *Diags=nullptr)
 Checks the input to FileCheck provided in the Buffer against the expected strings 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 139 of file FileCheck.h.

Constructor & Destructor Documentation

◆ FileCheck()

FileCheck::FileCheck ( FileCheckRequest  Req)
explicit

Definition at line 1125 of file FileCheck.cpp.

References ~FileCheck().

◆ ~FileCheck()

FileCheck::~FileCheck ( )
default

Referenced by FileCheck().

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 899 of file FileCheck.cpp.

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

◆ checkInput()

bool FileCheck::checkInput ( SourceMgr SM,
StringRef  Buffer,
std::vector< FileCheckDiag > *  Diags = nullptr 
)

Checks the input to FileCheck provided in the Buffer against the expected strings 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 1931 of file FileCheck.cpp.

References llvm::FileCheckString::Check(), llvm::Check::CheckLabel, llvm::numbers::e, llvm::FileCheckPattern::getCheckTy(), llvm::StringRef::npos, llvm::FileCheckString::Pat, and llvm::StringRef::substr().

◆ readCheckFile()

bool FileCheck::readCheckFile ( SourceMgr SM,
StringRef  Buffer,
Regex PrefixRE 
)

◆ ValidateCheckPrefixes()

bool FileCheck::ValidateCheckPrefixes ( )

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