LLVM
8.0.1
|
#include "llvm/Support/FileCheck.h"
#include "llvm/ADT/StringSet.h"
#include "llvm/Support/FormatVariadic.h"
#include <cstdint>
#include <list>
#include <map>
#include <tuple>
#include <utility>
Go to the source code of this file.
Functions | |
static SMRange | ProcessMatchResult (FileCheckDiag::MatchType MatchTy, const SourceMgr &SM, SMLoc Loc, Check::FileCheckType CheckTy, StringRef Buffer, size_t Pos, size_t Len, std::vector< FileCheckDiag > *Diags, bool AdjustPrevDiag=false) |
static bool | IsPartOfWord (char c) |
static std::pair< Check::FileCheckType, StringRef > | FindCheckType (StringRef Buffer, StringRef Prefix) |
static size_t | SkipWord (StringRef Str, size_t Loc) |
static std::pair< StringRef, StringRef > | FindFirstMatchingPrefix (Regex &PrefixRE, StringRef &Buffer, unsigned &LineNumber, Check::FileCheckType &CheckTy) |
Search the buffer for the first prefix in the prefix regular expression. More... | |
static void | PrintMatch (bool ExpectedMatch, const SourceMgr &SM, StringRef Prefix, SMLoc Loc, const FileCheckPattern &Pat, int MatchedCount, StringRef Buffer, StringMap< StringRef > &VariableTable, size_t MatchPos, size_t MatchLen, const FileCheckRequest &Req, std::vector< FileCheckDiag > *Diags) |
static void | PrintMatch (bool ExpectedMatch, const SourceMgr &SM, const FileCheckString &CheckStr, int MatchedCount, StringRef Buffer, StringMap< StringRef > &VariableTable, size_t MatchPos, size_t MatchLen, FileCheckRequest &Req, std::vector< FileCheckDiag > *Diags) |
static void | PrintNoMatch (bool ExpectedMatch, const SourceMgr &SM, StringRef Prefix, SMLoc Loc, const FileCheckPattern &Pat, int MatchedCount, StringRef Buffer, StringMap< StringRef > &VariableTable, bool VerboseVerbose, std::vector< FileCheckDiag > *Diags) |
static void | PrintNoMatch (bool ExpectedMatch, const SourceMgr &SM, const FileCheckString &CheckStr, int MatchedCount, StringRef Buffer, StringMap< StringRef > &VariableTable, bool VerboseVerbose, std::vector< FileCheckDiag > *Diags) |
static unsigned | CountNumNewlinesBetween (StringRef Range, const char *&FirstNewLine) |
Count the number of newlines in the specified range. More... | |
static bool | ValidateCheckPrefix (StringRef CheckPrefix) |
static void | ClearLocalVars (StringMap< StringRef > &VariableTable) |
Definition at line 1369 of file FileCheck.cpp.
References llvm::SmallVectorTemplateBase< T >::push_back().
Referenced by llvm::FileCheck::CheckInput().
Count the number of newlines in the specified range.
Definition at line 984 of file FileCheck.cpp.
References llvm::StringRef::begin(), llvm::StringRef::empty(), llvm::StringRef::find_first_of(), llvm::StringRef::size(), and llvm::StringRef::substr().
Referenced by llvm::FileCheckString::CheckNext(), and llvm::FileCheckString::CheckSame().
|
static |
Definition at line 616 of file FileCheck.cpp.
References llvm::Check::CheckBadCount, llvm::Check::CheckBadNot, llvm::Check::CheckDAG, llvm::Check::CheckEmpty, llvm::Check::CheckLabel, llvm::Check::CheckNext, llvm::Check::CheckNone, llvm::Check::CheckNot, llvm::Check::CheckPlain, llvm::Check::CheckSame, llvm::StringRef::drop_front(), llvm::Check::FileCheckType::setCount(), and llvm::StringRef::size().
Referenced by FindFirstMatchingPrefix().
|
static |
Search the buffer for the first prefix in the prefix regular expression.
This searches the buffer using the provided regular expression, however it enforces constraints beyond that: 1) The found prefix must not be a suffix of something that looks like a valid prefix. 2) The found prefix must be followed by a valid check type suffix using FindCheckType
above.
Returns a pair of StringRefs into the Buffer, which combines:
If this routine returns a valid prefix, it will also shrink Buffer
to start at the beginning of the returned prefix, increment LineNumber
for each new line consumed from Buffer
, and set CheckTy
to the type of check found by examining the suffix.
If no valid prefix is found, the state of Buffer, LineNumber, and CheckTy is unspecified.
Definition at line 701 of file FileCheck.cpp.
References assert(), llvm::StringRef::back(), llvm::Check::CheckNone, llvm::SmallVectorImpl< T >::clear(), llvm::StringRef::count(), llvm::StringRef::data(), llvm::StringRef::drop_front(), llvm::StringRef::empty(), FindCheckType(), IsPartOfWord(), llvm::Regex::match(), llvm::cl::Prefix, llvm::StringRef::size(), SkipWord(), and llvm::StringRef::substr().
Referenced by llvm::FileCheck::ReadCheckFile().
Definition at line 572 of file FileCheck.cpp.
Referenced by FindFirstMatchingPrefix(), and SkipWord().
|
static |
Definition at line 898 of file FileCheck.cpp.
References llvm::Check::CheckEOF, llvm::SourceMgr::DK_Error, llvm::SourceMgr::DK_Note, llvm::SourceMgr::DK_Remark, llvm::formatv(), llvm::FileCheckPattern::getCheckTy(), llvm::FileCheckPattern::getCount(), llvm::Check::FileCheckType::getDescription(), llvm::FileCheckDiag::MatchFoundAndExpected, llvm::FileCheckDiag::MatchFoundButExcluded, llvm::SourceMgr::PrintMessage(), llvm::FileCheckPattern::PrintVariableUses(), ProcessMatchResult(), llvm::SMRange::Start, llvm::FileCheckRequest::Verbose, and llvm::FileCheckRequest::VerboseVerbose.
Referenced by llvm::FileCheckString::Check(), llvm::FileCheckString::CheckNot(), and PrintMatch().
|
static |
Definition at line 928 of file FileCheck.cpp.
References llvm::FileCheckString::Loc, llvm::FileCheckString::Pat, llvm::FileCheckString::Prefix, and PrintMatch().
|
static |
Definition at line 938 of file FileCheck.cpp.
References llvm::SourceMgr::DK_Error, llvm::SourceMgr::DK_Note, llvm::SourceMgr::DK_Remark, llvm::StringRef::find_first_not_of(), llvm::formatv(), llvm::FileCheckPattern::getCheckTy(), llvm::FileCheckPattern::getCount(), llvm::Check::FileCheckType::getDescription(), llvm::FileCheckDiag::MatchNoneAndExcluded, llvm::FileCheckDiag::MatchNoneButExpected, llvm::FileCheckPattern::PrintFuzzyMatch(), llvm::SourceMgr::PrintMessage(), llvm::FileCheckPattern::PrintVariableUses(), ProcessMatchResult(), llvm::StringRef::size(), llvm::SMRange::Start, and llvm::StringRef::substr().
Referenced by llvm::FileCheckString::Check(), llvm::FileCheckString::CheckNot(), and PrintNoMatch().
|
static |
Definition at line 974 of file FileCheck.cpp.
References llvm::FileCheckString::Loc, llvm::FileCheckString::Pat, llvm::FileCheckString::Prefix, and PrintNoMatch().
|
static |
Definition at line 415 of file FileCheck.cpp.
Referenced by llvm::FileCheckString::Check(), llvm::FileCheckPattern::PrintFuzzyMatch(), PrintMatch(), and PrintNoMatch().
|
static |
Definition at line 671 of file FileCheck.cpp.
References IsPartOfWord(), and llvm::StringRef::size().
Referenced by FindFirstMatchingPrefix().
Definition at line 1320 of file FileCheck.cpp.
References llvm::Regex::match().
Referenced by llvm::FileCheck::ValidateCheckPrefixes().