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)
 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 275 of file FileCheck.h.

Constructor & Destructor Documentation

◆ FileCheck()

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

Definition at line 280 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 531 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.

Definition at line 1399 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 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: