[clang] [OpenACC] Implement initial parsing for Construct/Directive Names (PR #72661)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 17 07:24:19 PST 2023


================
@@ -0,0 +1,72 @@
+//===--- OpenACCKinds.h - OpenACC Enums -------------------------*- C++ -*-===//
+//
+// 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
+/// Defines some OpenACC-specific enums and functions.
+///
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_BASIC_OPENACCKINDS_H
+#define LLVM_CLANG_BASIC_OPENACCKINDS_H
+
+namespace clang {
+// Represents the Construct/Directive kind of a pragma directive. Note the
+// OpenACC standard is inconsistent between calling these Construct vs
+// Directive, but we're calling it a Directive to be consistent with OpenMP.
+enum class OpenACCDirectiveKind {
+  // Compute Constructs.
+  Parallel,
----------------
erichkeane wrote:

Our implementation strategy is to start with all of the 'parsing' first, starting at constructs, I don't see why this is an issue?  I understand the grammar enough that this seems valid.  

At this point, we HAVE successfully implemented parsing for all of the 'non-optional-parens' versions.  

Doing it this way permits us to do the implementation of clauses next: clauses in OpenACC are shared between all of the constructs, so implementing 1 construct at a time would prevent us from being able to do that.

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


More information about the cfe-commits mailing list