[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:36:30 PDT 2024


================
@@ -72,3 +92,9 @@ void OpenACCClausePrinter::VisitDefaultClause(const OpenACCDefaultClause &C) {
 void OpenACCClausePrinter::VisitIfClause(const OpenACCIfClause &C) {
   OS << "if(" << C.getConditionExpr() << ")";
 }
+
+void OpenACCClausePrinter::VisitSelfClause(const OpenACCSelfClause &C) {
+  OS << "self";
+  if (const Expr *CondExpr = C.getConditionExpr())
----------------
erichkeane wrote:

No, all that does is check if `CondExpr` is `nullptr`, so this is doing the same thing.  I thought this interface makes sense (that is, 'null' means no condition).

https://github.com/llvm/llvm-project/pull/88760


More information about the cfe-commits mailing list