[flang-commits] [flang] ae6e499 - [flang] This adds the lowering stubs for Open MP.

Eric Schweitz via flang-commits flang-commits at lists.llvm.org
Mon Jun 1 09:13:19 PDT 2020


Author: Eric Schweitz
Date: 2020-06-01T09:11:53-07:00
New Revision: ae6e499d258c24fde433d02793c327367c402d50

URL: https://github.com/llvm/llvm-project/commit/ae6e499d258c24fde433d02793c327367c402d50
DIFF: https://github.com/llvm/llvm-project/commit/ae6e499d258c24fde433d02793c327367c402d50.diff

LOG: [flang] This adds the lowering stubs for Open MP.

The lowering bridge will call these lowering hooks to process the Open
MP directives that it iterates over in the PFT.  This is a mock
interface without an implementation in this patch.

Reviewed By: kiranchandramohan

Differential Revision: https://reviews.llvm.org/D80815

Added: 
    flang/include/flang/Lower/AbstractConverter.h
    flang/include/flang/Lower/OpenMP.h
    flang/lib/Lower/OpenMP.cpp

Modified: 
    flang/lib/Lower/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/flang/include/flang/Lower/AbstractConverter.h b/flang/include/flang/Lower/AbstractConverter.h
new file mode 100644
index 000000000000..0716b841fa1e
--- /dev/null
+++ b/flang/include/flang/Lower/AbstractConverter.h
@@ -0,0 +1,19 @@
+//===-- Lower/AbstractConverter.h -------------------------------*- 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef FORTRAN_LOWER_ABSTRACTCONVERTER_H
+#define FORTRAN_LOWER_ABSTRACTCONVERTER_H
+
+namespace Fortran::lower {
+
+// temporary stub
+class AbstractConverter;
+
+} // namespace Fortran::lower
+
+#endif // FORTRAN_LOWER_ABSTRACTCONVERTER_H

diff  --git a/flang/include/flang/Lower/OpenMP.h b/flang/include/flang/Lower/OpenMP.h
new file mode 100644
index 000000000000..0b273a6aa734
--- /dev/null
+++ b/flang/include/flang/Lower/OpenMP.h
@@ -0,0 +1,35 @@
+//===-- Lower/OpenMP.h -- lower Open MP directives --------------*- 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef FORTRAN_LOWER_OPENMP_H
+#define FORTRAN_LOWER_OPENMP_H
+
+namespace Fortran {
+namespace parser {
+struct OpenMPConstruct;
+struct OmpEndLoopDirective;
+} // namespace parser
+
+namespace lower {
+
+class AbstractConverter;
+
+namespace pft {
+struct Evaluation;
+} // namespace pft
+
+void genOpenMPConstruct(AbstractConverter &, pft::Evaluation &,
+                        const parser::OpenMPConstruct &);
+
+void genOpenMPEndLoop(AbstractConverter &, pft::Evaluation &,
+                      const parser::OmpEndLoopDirective &);
+
+} // namespace lower
+} // namespace Fortran
+
+#endif // FORTRAN_LOWER_OPENMP_H

diff  --git a/flang/lib/Lower/CMakeLists.txt b/flang/lib/Lower/CMakeLists.txt
index 6cbcfc3b630e..9e1dbc782db6 100644
--- a/flang/lib/Lower/CMakeLists.txt
+++ b/flang/lib/Lower/CMakeLists.txt
@@ -1,5 +1,6 @@
 
 add_flang_library(FortranLower
+  OpenMP.cpp
   PFTBuilder.cpp
 
   LINK_COMPONENTS

diff  --git a/flang/lib/Lower/OpenMP.cpp b/flang/lib/Lower/OpenMP.cpp
new file mode 100644
index 000000000000..ad75eff0adb3
--- /dev/null
+++ b/flang/lib/Lower/OpenMP.cpp
@@ -0,0 +1,26 @@
+//===-- OpenMP.cpp -- Open MP directive lowering --------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#include "flang/Lower/OpenMP.h"
+#include "flang/Lower/AbstractConverter.h"
+#include "flang/Lower/PFTBuilder.h"
+#include "flang/Parser/parse-tree.h"
+
+#define TODO() llvm_unreachable("not yet implemented")
+
+void Fortran::lower::genOpenMPConstruct(
+    Fortran::lower::AbstractConverter &, Fortran::lower::pft::Evaluation &,
+    const Fortran::parser::OpenMPConstruct &) {
+  TODO();
+}
+
+void Fortran::lower::genOpenMPEndLoop(
+    Fortran::lower::AbstractConverter &, Fortran::lower::pft::Evaluation &,
+    const Fortran::parser::OmpEndLoopDirective &) {
+  TODO();
+}


        


More information about the flang-commits mailing list