[flang-commits] [flang] [llvm] [Frontend][OpenMP] introduce OMP.h header file, use it instead of OMP… (PR #84188)

Krzysztof Parzyszek via flang-commits flang-commits at lists.llvm.org
Thu Mar 7 04:52:31 PST 2024


https://github.com/kparzysz updated https://github.com/llvm/llvm-project/pull/84188

>From f3033fb4049dd3517796dee06de76d64ba688e39 Mon Sep 17 00:00:00 2001
From: Krzysztof Parzyszek <Krzysztof.Parzyszek at amd.com>
Date: Wed, 6 Mar 2024 07:43:41 -0600
Subject: [PATCH] [Frontend][OpenMP] introduce OMP.h header file, use it
 instead of OMP.h.inc

The consumers of OpenMP-related definitions include a TableGen-generated
file OMP.h.inc.  Having a separate OMP.h allows putting additional decla-
rations in there that are not auto-generated.

This patch is NFC.
---
 flang/lib/Semantics/rewrite-directives.cpp     |  2 +-
 llvm/include/llvm/Frontend/OpenMP/OMP.h        | 18 ++++++++++++++++++
 .../llvm/Frontend/OpenMP/OMPConstants.h        |  3 +--
 llvm/lib/Frontend/OpenMP/OMP.cpp               |  2 +-
 4 files changed, 21 insertions(+), 4 deletions(-)
 create mode 100644 llvm/include/llvm/Frontend/OpenMP/OMP.h

diff --git a/flang/lib/Semantics/rewrite-directives.cpp b/flang/lib/Semantics/rewrite-directives.cpp
index bab91d25308225..2c3c87f2546a35 100644
--- a/flang/lib/Semantics/rewrite-directives.cpp
+++ b/flang/lib/Semantics/rewrite-directives.cpp
@@ -11,7 +11,7 @@
 #include "flang/Parser/parse-tree.h"
 #include "flang/Semantics/semantics.h"
 #include "flang/Semantics/symbol.h"
-#include "llvm/Frontend/OpenMP/OMP.h.inc"
+#include "llvm/Frontend/OpenMP/OMP.h"
 #include <list>
 
 namespace Fortran::semantics {
diff --git a/llvm/include/llvm/Frontend/OpenMP/OMP.h b/llvm/include/llvm/Frontend/OpenMP/OMP.h
new file mode 100644
index 00000000000000..a85cd9d344c6d7
--- /dev/null
+++ b/llvm/include/llvm/Frontend/OpenMP/OMP.h
@@ -0,0 +1,18 @@
+//===-- OMP.h - Core OpenMP definitions and declarations ---------- 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
+//
+//===----------------------------------------------------------------------===//
+//
+// This file contains the core set of OpenMP definitions and declarations.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_FRONTEND_OPENMP_OMP_H
+#define LLVM_FRONTEND_OPENMP_OMP_H
+
+#include "llvm/Frontend/OpenMP/OMP.h.inc"
+
+#endif // LLVM_FRONTEND_OPENMP_OMP_H
diff --git a/llvm/include/llvm/Frontend/OpenMP/OMPConstants.h b/llvm/include/llvm/Frontend/OpenMP/OMPConstants.h
index f8812e7955b82d..1bfaf3718552e5 100644
--- a/llvm/include/llvm/Frontend/OpenMP/OMPConstants.h
+++ b/llvm/include/llvm/Frontend/OpenMP/OMPConstants.h
@@ -15,9 +15,8 @@
 #define LLVM_FRONTEND_OPENMP_OMPCONSTANTS_H
 
 #include "llvm/ADT/BitmaskEnum.h"
-
 #include "llvm/ADT/StringRef.h"
-#include "llvm/Frontend/OpenMP/OMP.h.inc"
+#include "llvm/Frontend/OpenMP/OMP.h"
 
 namespace llvm {
 namespace omp {
diff --git a/llvm/lib/Frontend/OpenMP/OMP.cpp b/llvm/lib/Frontend/OpenMP/OMP.cpp
index eac5d4168c5ca4..4f2f95392648b3 100644
--- a/llvm/lib/Frontend/OpenMP/OMP.cpp
+++ b/llvm/lib/Frontend/OpenMP/OMP.cpp
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "llvm/Frontend/OpenMP/OMP.h.inc"
+#include "llvm/Frontend/OpenMP/OMP.h"
 
 #include "llvm/ADT/StringRef.h"
 #include "llvm/ADT/StringSwitch.h"



More information about the flang-commits mailing list