[clang] [OpenACC] Implement beginning parts of the 'parallel' Sema impl (PR #81659)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 16 07:18:39 PST 2024


================
@@ -0,0 +1,132 @@
+//===--- SemaOpenACC.cpp - Semantic Analysis for OpenACC constructs -------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+/// \file
+/// This file implements semantic analysis for OpenACC constructs and
+/// clauses.
+///
+//===----------------------------------------------------------------------===//
+
+#include "clang/Basic/DiagnosticSema.h"
+#include "clang/Basic/OpenACCKinds.h"
+#include "clang/Sema/Sema.h"
+
+using namespace clang;
+
+namespace {
+bool DiagnoseConstructAppertainment(Sema &S, OpenACCDirectiveKind K,
+                                    SourceLocation StartLoc, bool IsStmt) {
+  switch (K) {
+  default:
+  case OpenACCDirectiveKind::Invalid:
+    // Nothing to do here, both invalid and unimplemented don't really need to
+    // do anything.
+    break;
----------------
erichkeane wrote:

No, that would just end up crashing, we're calling into the 'act on start' even when invalid, which should allow us to handle 'state' of bad pragmas better, so 'invalid' has to get through here without causing problems.  The intent is that we wont create an AST node here, but still allow 'checking' of everything else.

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


More information about the cfe-commits mailing list