Author: erichkeane Date: 2024-01-16T07:04:28-08:00 New Revision: d835d6f4fface8ac093b7583e07f4ce5b1802042
URL: https://github.com/llvm/llvm-project/commit/d835d6f4fface8ac093b7583e07f4ce5b1802042 DIFF: https://github.com/llvm/llvm-project/commit/d835d6f4fface8ac093b7583e07f4ce5b1802042.diff LOG: [OpenACC} Improve diagnostics for 'tag's on clauses/directives The 'cache' directive and various clauses have a 'tag' name that is optional. This patch cleans up the use of the 'cache' version so that we get a nicer diagnostic, and enables us to do the same with clauses in the same situation. Added: Modified: clang/lib/Parse/ParseOpenACC.cpp Removed: ################################################################################ diff --git a/clang/lib/Parse/ParseOpenACC.cpp b/clang/lib/Parse/ParseOpenACC.cpp index a5a028e1c6a799..018c61de4be369 100644 --- a/clang/lib/Parse/ParseOpenACC.cpp +++ b/clang/lib/Parse/ParseOpenACC.cpp @@ -183,7 +183,7 @@ bool isTokenIdentifierOrKeyword(Parser &P, Token Tok) { /// Return 'true' if the special token was matched, false if no special token, /// or an invalid special token was found. template <typename DirOrClauseTy> -bool tryParseAndConsumeSpecialTokenKind(Parser &P, OpenACCSpecialTokenKind Kind, +bool TryParseAndConsumeSpecialTokenKind(Parser &P, OpenACCSpecialTokenKind Kind, DirOrClauseTy DirOrClause) { Token IdentTok = P.getCurToken(); // If this is an identifier-like thing followed by ':', it is one of the @@ -713,7 +713,7 @@ void Parser::ParseOpenACCCacheVarList() { // The VarList is an optional `readonly:` followed by a list of a variable // specifications. Consume something that looks like a 'tag', and diagnose if // it isn't 'readonly'. - if (tryParseAndConsumeSpecialTokenKind(*this, + if (TryParseAndConsumeSpecialTokenKind(*this, OpenACCSpecialTokenKind::ReadOnly, OpenACCDirectiveKind::Cache)) { // FIXME: Record that this is a 'readonly' so that we can use that during _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits