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

Joseph Huber via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu May 21 06:15:35 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 =
----------------
jhuber6 wrote:

I'm a little hesitant to put this in the core SanitizerArgs because it seems to be purely AMDGPU specific. Would it be possible to have a virtual function in the ToolChain or something?  I'd expect us to be able to check `OPT_mcpu` instead of the bound architecture as well.

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


More information about the llvm-branch-commits mailing list