[clang] [OpenACC] Implement Sema work for OpenACC Clauses (PR #87821)

Alexey Bataev via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 8 07:58:43 PDT 2024


================
@@ -37,6 +37,32 @@ bool diagnoseConstructAppertainment(SemaOpenACC &S, OpenACCDirectiveKind K,
   }
   return false;
 }
+
+bool doesClauseApplyToDirective(OpenACCDirectiveKind DirectiveKind,
+                                OpenACCClauseKind ClauseKind) {
+  switch (ClauseKind) {
+    // FIXME: For each clause as we implement them, we can add the
+    // 'legalization' list here.
+  default:
+    // Do nothing so we can go to the 'unimplemented' diagnostic instead.
+    return true;
+  }
+  llvm_unreachable("Invalid clause kind");
+}
+
+/// Destruct and deallocate any clauses that aren't going to be used because
+/// they don't have a Construct to attach to.
+void DestroyUnusedClauses(ASTContext &Ctx,
----------------
alexey-bataev wrote:

Not sure this is a real issue. I think it is enough just to report the error (or warning) and just ignore the clauses in the codegen.

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


More information about the cfe-commits mailing list