[clang] [OpenACC] Implement `self` clause for compute constructs (PR #88760)
Erich Keane via cfe-commits
cfe-commits at lists.llvm.org
Tue Apr 16 06:21:38 PDT 2024
================
@@ -160,12 +169,58 @@ SemaOpenACC::ActOnClause(ArrayRef<const OpenACCClause *> ExistingClauses,
// The parser has ensured that we have a proper condition expr, so there
// isn't really much to do here.
- // TODO OpenACC: When we implement 'self', this clauses causes us to
- // 'ignore' the self clause, so we should implement a warning here.
+ // If the 'if' clause is true, it makes the 'self' clause have no effect,
+ // diagnose that here.
+ // TODO OpenACC: When we add these two to other constructs, we might not
+ // want to warn on this (for example, 'update').
+ const auto *Itr =
+ llvm::find_if(ExistingClauses, [](const OpenACCClause *C) {
+ return C->getClauseKind() == OpenACCClauseKind::Self;
+ });
----------------
erichkeane wrote:
Cool! TIL!
https://github.com/llvm/llvm-project/pull/88760
More information about the cfe-commits
mailing list