[clang] Reapply "[Driver][ROCm][OpenMP] Fix default ockl linking for OpenMP."… (PR #126671)

Joseph Huber via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 11 08:37:12 PST 2025


================
@@ -68,7 +68,9 @@ llvm::opt::DerivedArgList *AMDGPUOpenMPToolChain::TranslateArgs(
     Action::OffloadKind DeviceOffloadKind) const {
   DerivedArgList *DAL =
       HostTC.TranslateArgs(Args, BoundArch, DeviceOffloadKind);
-  if (!DAL || Args.hasArg(options::OPT_fsanitize_EQ))
+  // Skip sanitize options passed from the HostTC. The decision to instrument
+  // device code is computed only by 'shouldSkipSanitizeOption'.
+  if (!DAL && DAL->hasArg(options::OPT_fsanitize_EQ))
----------------
jhuber6 wrote:

So, is it prohibitively difficult to do something more akin to.

```c
if (Args.hasFlag(OPT_fsanitize_address, OPT_fno_sanitize, false) &&
    Args.hasFlag(OPT_fgpu_sanitize, OPT_fno_gpu_sanitize, true)) {
  if (isSanitizerLegal(Args))
    // something
  else
    Diags.warn("incompatible, ignoring");    
}
``` 

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


More information about the cfe-commits mailing list