================
@@ -492,6 +493,18 @@ void Flang::addOffloadOptions(Compilation &C, const 
InputInfoList &Inputs,
     if (Args.hasArg(options::OPT_nogpulib))
       CmdArgs.push_back("-nogpulib");
   }
+
+  // For all the host OpenMP offloading compile jobs we need to pass the 
targets
+  // information using -fopenmp-targets= option.
+  if (JA.isHostOffloading(Action::OFK_OpenMP)) {
+    SmallString<128> Targets("-fopenmp-targets=");
----------------
banach-space wrote:

This looks to be taken verbatim from Clang:
* 
https://github.com/llvm/llvm-project/blob/2ba3fe7356f065757a2279f65e4ef5c8f1476293/clang/lib/Driver/ToolChains/Clang.cpp#L7768-L7778

It should be extracted to a dedicated hook and moved to 
https://github.com/llvm/llvm-project/blob/main/clang/lib/Driver/ToolChains/CommonArgs.cpp.
  That's the best we have today. 

>  I think @banach-space is the expert on this area, so maybe he knows of any 
> plans already in place to improve this situation or can give us some pointers 
> on how to better deal with this in the short term.

These days I only have very limited bandwidth to _review_ driver patches. 
Please consider every contribution that you make as an opportunity to improve 
code re-use between Clang and Flang.

https://github.com/llvm/llvm-project/pull/100152
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to