[flang-commits] [flang] 7ccacaf - [flang][examples] Add missing CMake dependencies

Andrzej Warzynski via flang-commits flang-commits at lists.llvm.org
Mon Jan 24 01:36:05 PST 2022


Author: Andrzej Warzynski
Date: 2022-01-24T09:34:46Z
New Revision: 7ccacaf4428d1712029594184baa6f617a51c340

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

LOG: [flang][examples] Add missing CMake dependencies

Currently, everything that includes "flang/Parser/parse-tree.h" in Flang
depends on the `gen_acc` and `gen_omp` CMake targets (these targets
generate include files that are used in "parse-tree.h"). The examples in
Flang do use this header file and hence also depend on
`gen_acc`/`gen_omp`. This patch updates relevant CMake scripts
accordingly.

I've also taken the liberty to rename some of the example files so that
their names follow LLVM's coding guidelines.

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

Added: 
    flang/examples/FlangOmpReport/CMakeLists.txt
    flang/examples/FlangOmpReport/FlangOmpReport.cpp
    flang/examples/FlangOmpReport/FlangOmpReportVisitor.cpp
    flang/examples/FlangOmpReport/FlangOmpReportVisitor.h
    flang/examples/FlangOmpReport/requirements.txt
    flang/examples/FlangOmpReport/yaml_summarizer.py

Modified: 
    flang/examples/CMakeLists.txt
    flang/examples/PrintFlangFunctionNames/CMakeLists.txt

Removed: 
    flang/examples/flang-omp-report-plugin/CMakeLists.txt
    flang/examples/flang-omp-report-plugin/flang-omp-report-visitor.cpp
    flang/examples/flang-omp-report-plugin/flang-omp-report-visitor.h
    flang/examples/flang-omp-report-plugin/flang-omp-report.cpp
    flang/examples/flang-omp-report-plugin/requirements.txt
    flang/examples/flang-omp-report-plugin/yaml_summarizer.py


################################################################################
diff  --git a/flang/examples/CMakeLists.txt b/flang/examples/CMakeLists.txt
index f9b656ce86fe1..b0a78eeaa4eaa 100644
--- a/flang/examples/CMakeLists.txt
+++ b/flang/examples/CMakeLists.txt
@@ -12,4 +12,4 @@ target_link_libraries(external-hello-world
 )
 
 add_subdirectory(PrintFlangFunctionNames)
-add_subdirectory(flang-omp-report-plugin)
+add_subdirectory(FlangOmpReport)

diff  --git a/flang/examples/FlangOmpReport/CMakeLists.txt b/flang/examples/FlangOmpReport/CMakeLists.txt
new file mode 100644
index 0000000000000..aebebe92d6b30
--- /dev/null
+++ b/flang/examples/FlangOmpReport/CMakeLists.txt
@@ -0,0 +1,9 @@
+add_llvm_library(flangOmpReport
+  MODULE
+  FlangOmpReport.cpp
+  FlangOmpReportVisitor.cpp
+
+  DEPENDS
+  acc_gen
+  omp_gen
+)

diff  --git a/flang/examples/flang-omp-report-plugin/flang-omp-report.cpp b/flang/examples/FlangOmpReport/FlangOmpReport.cpp
similarity index 98%
rename from flang/examples/flang-omp-report-plugin/flang-omp-report.cpp
rename to flang/examples/FlangOmpReport/FlangOmpReport.cpp
index 9ee8eb1a80cbd..0fa7582561d27 100644
--- a/flang/examples/flang-omp-report-plugin/flang-omp-report.cpp
+++ b/flang/examples/FlangOmpReport/FlangOmpReport.cpp
@@ -15,7 +15,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "flang-omp-report-visitor.h"
+#include "FlangOmpReportVisitor.h"
 
 #include "flang/Frontend/CompilerInstance.h"
 #include "flang/Frontend/FrontendActions.h"

diff  --git a/flang/examples/flang-omp-report-plugin/flang-omp-report-visitor.cpp b/flang/examples/FlangOmpReport/FlangOmpReportVisitor.cpp
similarity index 99%
rename from flang/examples/flang-omp-report-plugin/flang-omp-report-visitor.cpp
rename to flang/examples/FlangOmpReport/FlangOmpReportVisitor.cpp
index 32dcef25fedab..a0c3b194bfd31 100644
--- a/flang/examples/flang-omp-report-plugin/flang-omp-report-visitor.cpp
+++ b/flang/examples/FlangOmpReport/FlangOmpReportVisitor.cpp
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "flang-omp-report-visitor.h"
+#include "FlangOmpReportVisitor.h"
 #include "llvm/ADT/StringExtras.h"
 
 namespace Fortran {

diff  --git a/flang/examples/flang-omp-report-plugin/flang-omp-report-visitor.h b/flang/examples/FlangOmpReport/FlangOmpReportVisitor.h
similarity index 100%
rename from flang/examples/flang-omp-report-plugin/flang-omp-report-visitor.h
rename to flang/examples/FlangOmpReport/FlangOmpReportVisitor.h

diff  --git a/flang/examples/flang-omp-report-plugin/requirements.txt b/flang/examples/FlangOmpReport/requirements.txt
similarity index 100%
rename from flang/examples/flang-omp-report-plugin/requirements.txt
rename to flang/examples/FlangOmpReport/requirements.txt

diff  --git a/flang/examples/flang-omp-report-plugin/yaml_summarizer.py b/flang/examples/FlangOmpReport/yaml_summarizer.py
similarity index 100%
rename from flang/examples/flang-omp-report-plugin/yaml_summarizer.py
rename to flang/examples/FlangOmpReport/yaml_summarizer.py

diff  --git a/flang/examples/PrintFlangFunctionNames/CMakeLists.txt b/flang/examples/PrintFlangFunctionNames/CMakeLists.txt
index 6b107b4e1ea53..490f2ea895163 100644
--- a/flang/examples/PrintFlangFunctionNames/CMakeLists.txt
+++ b/flang/examples/PrintFlangFunctionNames/CMakeLists.txt
@@ -1,7 +1,10 @@
 # TODO: Note that this is currently only available on Linux.
 # On Windows, we would also have to specify e.g. `PLUGIN_TOOL`.
-add_llvm_library(
-    flangPrintFunctionNames
+add_llvm_library(flangPrintFunctionNames
     MODULE
     PrintFlangFunctionNames.cpp
+
+    DEPENDS
+    acc_gen
+    omp_gen
 )

diff  --git a/flang/examples/flang-omp-report-plugin/CMakeLists.txt b/flang/examples/flang-omp-report-plugin/CMakeLists.txt
deleted file mode 100644
index 993ba320d7570..0000000000000
--- a/flang/examples/flang-omp-report-plugin/CMakeLists.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-add_llvm_library(
-  flangOmpReport
-  MODULE
-  flang-omp-report.cpp
-  flang-omp-report-visitor.cpp
-)


        


More information about the flang-commits mailing list