[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
This commit is contained in:
Andrzej Warzynski 2022-01-11 13:16:03 +00:00
parent 67346b43e0
commit 7ccacaf442
9 changed files with 17 additions and 11 deletions

View File

@ -12,4 +12,4 @@ target_link_libraries(external-hello-world
)
add_subdirectory(PrintFlangFunctionNames)
add_subdirectory(flang-omp-report-plugin)
add_subdirectory(FlangOmpReport)

View File

@ -0,0 +1,9 @@
add_llvm_library(flangOmpReport
MODULE
FlangOmpReport.cpp
FlangOmpReportVisitor.cpp
DEPENDS
acc_gen
omp_gen
)

View File

@ -15,7 +15,7 @@
//
//===----------------------------------------------------------------------===//
#include "flang-omp-report-visitor.h"
#include "FlangOmpReportVisitor.h"
#include "flang/Frontend/CompilerInstance.h"
#include "flang/Frontend/FrontendActions.h"

View File

@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
#include "flang-omp-report-visitor.h"
#include "FlangOmpReportVisitor.h"
#include "llvm/ADT/StringExtras.h"
namespace Fortran {

View File

@ -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
)

View File

@ -1,6 +0,0 @@
add_llvm_library(
flangOmpReport
MODULE
flang-omp-report.cpp
flang-omp-report-visitor.cpp
)