From c720f920094e445af23ce8e214813f57694ab716 Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Tue, 27 May 2025 16:58:04 -0400 Subject: [HIP] disable sanitizer for `__hip_cuid` (#141581) Global variable `__hip_cuid_*` is for identifying purpose and does not need sanitization, therefore disable it for sanitizers. --- clang/lib/CodeGen/CodeGenModule.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'clang/lib/CodeGen/CodeGenModule.cpp') diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 16e010a..039507b 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -971,6 +971,7 @@ void CodeGenModule::Release() { getModule(), Int8Ty, false, llvm::GlobalValue::ExternalLinkage, llvm::Constant::getNullValue(Int8Ty), "__hip_cuid_" + getContext().getCUIDHash()); + getSanitizerMetadata()->disableSanitizerForGlobal(GV); addCompilerUsedGlobal(GV); } emitLLVMUsed(); -- cgit v1.1