[clang] [clang] Add isOffloadingTarget function to LangOpts (PR #126956)

Joseph Huber via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 17 09:20:07 PDT 2025


================
@@ -4357,6 +4357,10 @@ bool CompilerInvocation::ParseLangArgs(LangOptions &Opts, ArgList &Args,
       Opts.OpenACCMacroOverride = A->getValue();
   }
 
+  Opts.IsOffloadingTarget =
+      (Opts.OpenMPIsTargetDevice || Opts.SYCLIsDevice || Opts.CUDAIsDevice) &&
----------------
jhuber6 wrote:

I guess the concern is that this isn't strictly a language option since it depends on the target. This is more like "isGPUOffloadingTarget." We could possibly split these into two. One goes in the `TargetInfo` and one goes in the `LangOpts`?

https://github.com/llvm/llvm-project/pull/126956


More information about the cfe-commits mailing list