LLVM
8.0.1
|
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... | |
FileCheck class takes the request and exposes various methods that use information from the request.
Definition at line 246 of file FileCheck.h.
|
inline |
Definition at line 250 of file FileCheck.h.
Regex llvm::FileCheck::buildCheckPrefixRegex | ( | ) |
Definition at line 1348 of file FileCheck.cpp.
References llvm::SmallString< InternalLen >::append(), llvm::StringRef::front(), llvm::cl::Prefix, and llvm::SmallVectorTemplateBase< T, bool >::push_back().
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().
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().
bool llvm::FileCheck::ReadCheckFile | ( | SourceMgr & | SM, |
StringRef | Buffer, | ||
Regex & | PrefixRE, | ||
std::vector< FileCheckString > & | CheckStrings | ||
) |
Read the check file, which specifies the sequence of expected strings.
The strings are added to the CheckStrings vector. Returns true in case of an error, false otherwise.
Definition at line 751 of file FileCheck.cpp.
References llvm::SourceMgr::AddNewSourceBuffer(), assert(), llvm::Check::CheckBadCount, llvm::Check::CheckBadNot, llvm::Check::CheckDAG, llvm::Check::CheckEmpty, llvm::Check::CheckEOF, llvm::Check::CheckLabel, llvm::Check::CheckNext, llvm::Check::CheckNot, llvm::Check::CheckSame, llvm::FileCheckDiag::CheckTy, llvm::StringRef::data(), llvm::SourceMgr::DK_Error, llvm::StringRef::drop_front(), E, llvm::StringRef::empty(), llvm::errs(), llvm::StringRef::find_first_not_of(), llvm::StringRef::find_first_of(), FindFirstMatchingPrefix(), llvm::SMLoc::getFromPointer(), llvm::MemoryBuffer::getMemBufferCopy(), I, P, llvm::cl::Prefix, llvm::SourceMgr::PrintMessage(), llvm::StringRef::size(), llvm::StringRef::substr(), and std::swap().
bool llvm::FileCheck::ValidateCheckPrefixes | ( | ) |
Definition at line 1325 of file FileCheck.cpp.
References llvm::StringSet< AllocatorTy >::insert(), llvm::cl::Prefix, and ValidateCheckPrefix().