[Flang][Driver] Add support for fopenmp-is-device and fembed-offload-object to Flang...
authorAndrew Gozillon <Andrew.Gozillon@amd.com>
Fri, 17 Mar 2023 16:06:55 +0000 (11:06 -0500)
committerAndrew Gozillon <Andrew.Gozillon@amd.com>
Fri, 17 Mar 2023 16:12:16 +0000 (11:12 -0500)
commit0cd31a7d308714d26f49391ac4ea9f6bce5fa324
treefdcb3d16efb584fed70c8aa0d6e83627b6e29338
parent55140fbbcd6527a3fe3636dda2078fe3652558ec
[Flang][Driver] Add support for fopenmp-is-device and fembed-offload-object to Flang ToolChain

This allows-fembed-offload-object's and -fopenmp-is-device
compiler invocation arguments to be passed to the Flang frontend
during split compilation when offloading in OpenMP.

An example use case is when passing an offload-arch alongside
-fopenmp to embed device objects compiled for the offload-arch
within the host architecture.

This borrows from existing clangDriver+Clang.h/.cpp work and the intent
is currently to reuse as much of the existing infrastructure and design as
we can to achieve offloading for Flang+OpenMP. An overview of
Clang's offloading design can be found
here: https://clang.llvm.org/docs/OffloadingDesign.html

Reviewers:
awarzynski
jhuber6

Differential Revision: https://reviews.llvm.org/D145815
clang/lib/Driver/ToolChains/Flang.cpp
clang/lib/Driver/ToolChains/Flang.h
flang/test/Driver/omp-frontend-forwarding.f90 [new file with mode: 0644]