[llvm-branch-commits] [clang] clang: Refactor handling of offload sanitizer arguments (PR #196737)

Matt Arsenault via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu May 21 06:17:48 PDT 2026


================
@@ -540,15 +550,79 @@ SanitizerArgs::SanitizerArgs(const ToolChain &TC,
         DiagnosedKinds |= SanitizerKind::CFIMFCall;
       }
 
-      if (SanitizerMask KindsToDiagnose = Add & ~Supported & ~DiagnosedKinds) {
-        if (DiagnoseErrors) {
-          std::string Desc = describeSanitizeArg(Arg, KindsToDiagnose);
+      // Check for sanitizers that are supported by the toolchain but not for
+      // this specific arch (e.g., AMDGPU requires specific subtarget features
+      // for address sanitizer.)
+      if (SanitizerMask ArchSpecificUnsupported =
----------------
arsenm wrote:

This also should not consider -mcpu. This is only the behavior for offload with mixed architectures. Nonoffload will always error on unhandled sanitizers 

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


More information about the llvm-branch-commits mailing list