LLVM 22.0.0git
|
FileCheck class takes the request and exposes various methods that use information from the request. More...
#include "llvm/FileCheck/FileCheck.h"
Public Member Functions | |
LLVM_ABI | FileCheck (FileCheckRequest Req) |
LLVM_ABI | ~FileCheck () |
LLVM_ABI bool | readCheckFile (SourceMgr &SM, StringRef Buffer, std::pair< unsigned, unsigned > *ImpPatBufferIDRange=nullptr) |
Reads the check file from Buffer and records the expected strings it contains. | |
LLVM_ABI bool | ValidateCheckPrefixes () |
LLVM_ABI StringRef | CanonicalizeFile (MemoryBuffer &MB, SmallVectorImpl< char > &OutputBuffer) |
Canonicalizes whitespaces in the file. | |
LLVM_ABI 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 . | |
FileCheck class takes the request and exposes various methods that use information from the request.
Definition at line 182 of file FileCheck.h.
|
explicit |
Definition at line 1812 of file FileCheck.cpp.
|
default |
StringRef FileCheck::CanonicalizeFile | ( | MemoryBuffer & | MB, |
SmallVectorImpl< char > & | OutputBuffer | ||
) |
Canonicalizes whitespaces in the file.
Line endings are replaced with UNIX-style '
'.
Definition at line 1474 of file FileCheck.cpp.
References llvm::SmallVectorTemplateCommon< T, typename >::data(), End, llvm::MemoryBuffer::getBufferEnd(), llvm::MemoryBuffer::getBufferSize(), llvm::MemoryBuffer::getBufferStart(), llvm::FileCheckRequest::NoCanonicalizeWhiteSpace, Ptr, llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::SmallVectorImpl< T >::reserve(), and llvm::SmallVectorBase< Size_T >::size().
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
.
Definition at line 2714 of file FileCheck.cpp.
References llvm::FileCheckString::Check(), llvm::Check::CheckLabel, llvm::FileCheckRequest::EnableVarScope, llvm::Pattern::getCheckTy(), llvm::StringRef::npos, llvm::FileCheckString::Pat, and llvm::StringRef::substr().
bool FileCheck::readCheckFile | ( | SourceMgr & | SM, |
StringRef | Buffer, | ||
std::pair< unsigned, unsigned > * | ImpPatBufferIDRange = nullptr |
||
) |
Reads the check file from Buffer
and records the expected strings it contains.
Errors are reported against SM
.
If ImpPatBufferIDRange
, then the range (inclusive start, exclusive end) of IDs for source buffers added to SM
for implicit patterns are recorded in it. The range is empty if there are none.
Definition at line 1817 of file FileCheck.cpp.
References addDefaultPrefixes(), llvm::SourceMgr::AddNewSourceBuffer(), llvm::FileCheckRequest::AllowUnusedPrefixes, assert(), llvm::Check::CheckBadCount, llvm::Check::CheckBadNot, llvm::Check::CheckComment, llvm::Check::CheckDAG, llvm::Check::CheckEmpty, llvm::Check::CheckEOF, llvm::Check::CheckLabel, llvm::Check::CheckMisspelled, llvm::Check::CheckNext, llvm::Check::CheckNot, llvm::FileCheckRequest::CheckPrefixes, llvm::Check::CheckSame, llvm::FileCheckRequest::CommentPrefixes, llvm::StringRef::data(), llvm::SourceMgr::DK_Error, llvm::StringRef::drop_front(), llvm::StringRef::empty(), llvm::errs(), llvm::StringRef::find_first_not_of(), llvm::StringRef::find_first_of(), FindFirstMatchingPrefix(), llvm::First, llvm::SMLoc::getFromPointer(), llvm::MemoryBuffer::getMemBufferCopy(), llvm::FileCheckRequest::GlobalDefines, llvm::FileCheckRequest::ImplicitCheckNot, llvm::FileCheckRequest::IsDefaultCheckPrefix, llvm::logAllUnhandledErrors(), llvm::FileCheckRequest::MatchFullLines, llvm::FileCheckRequest::NoCanonicalizeWhiteSpace, P, llvm::SourceMgr::PrintMessage(), llvm::StringRef::size(), and llvm::StringRef::substr().
bool FileCheck::ValidateCheckPrefixes | ( | ) |
Definition at line 2536 of file FileCheck.cpp.
References llvm::FileCheckRequest::CheckPrefixes, llvm::FileCheckRequest::CommentPrefixes, DefaultCheckPrefixes, DefaultCommentPrefixes, llvm::StringSet< AllocatorTy >::insert_range(), and ValidatePrefixes().