diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2024-01-24 19:17:23 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2024-04-19 21:24:44 +0000 |
commit | ab50317e96e57dee5b3ff4ad3f16f205b2a3359e (patch) | |
tree | 4b1f388eb6a07e574417aaacecd3ec4a83550718 /contrib/llvm-project/llvm/lib/FileCheck/FileCheckImpl.h | |
parent | 412542983a5ba62902141a8a7e155cceb9196a66 (diff) |
Diffstat (limited to 'contrib/llvm-project/llvm/lib/FileCheck/FileCheckImpl.h')
-rw-r--r-- | contrib/llvm-project/llvm/lib/FileCheck/FileCheckImpl.h | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/contrib/llvm-project/llvm/lib/FileCheck/FileCheckImpl.h b/contrib/llvm-project/llvm/lib/FileCheck/FileCheckImpl.h index c15461684ea3..c772eddd8ecd 100644 --- a/contrib/llvm-project/llvm/lib/FileCheck/FileCheckImpl.h +++ b/contrib/llvm-project/llvm/lib/FileCheck/FileCheckImpl.h @@ -823,9 +823,19 @@ struct FileCheckString { /// The location in the match file that the check string was specified. SMLoc Loc; - /// All of the strings that are disallowed from occurring between this match - /// string and the previous one (or start of file). - std::vector<Pattern> DagNotStrings; + /// Hold the information about the DAG/NOT strings in the program, which are + /// not explicitly stored otherwise. This allows for better and more accurate + /// diagnostic messages. + struct DagNotPrefixInfo { + Pattern DagNotPat; + StringRef DagNotPrefix; + + DagNotPrefixInfo(const Pattern &P, StringRef S) + : DagNotPat(P), DagNotPrefix(S) {} + }; + + /// Hold the DAG/NOT strings occurring in the input file. + std::vector<DagNotPrefixInfo> DagNotStrings; FileCheckString(const Pattern &P, StringRef S, SMLoc L) : Pat(P), Prefix(S), Loc(L) {} @@ -845,12 +855,12 @@ struct FileCheckString { /// \p Buffer. Errors are reported against \p SM and diagnostics recorded in /// \p Diags according to the verbosity level set in \p Req. bool CheckNot(const SourceMgr &SM, StringRef Buffer, - const std::vector<const Pattern *> &NotStrings, + const std::vector<const DagNotPrefixInfo *> &NotStrings, const FileCheckRequest &Req, std::vector<FileCheckDiag> *Diags) const; /// Matches "dag strings" and their mixed "not strings". size_t CheckDag(const SourceMgr &SM, StringRef Buffer, - std::vector<const Pattern *> &NotStrings, + std::vector<const DagNotPrefixInfo *> &NotStrings, const FileCheckRequest &Req, std::vector<FileCheckDiag> *Diags) const; }; |