aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorYaxun (Sam) Liu <yaxun.liu@amd.com>2025-05-27 16:58:04 -0400
committerGitHub <noreply@github.com>2025-05-27 16:58:04 -0400
commitc720f920094e445af23ce8e214813f57694ab716 (patch)
treec0e24de25ab5285f0367c05e79782a7622ba7aba /clang/lib/CodeGen/CodeGenModule.cpp
parent9cf4603bf9e3bc4249fbe0d183fa31f2bba1eb7e (diff)
downloadllvm-c720f920094e445af23ce8e214813f57694ab716.zip
llvm-c720f920094e445af23ce8e214813f57694ab716.tar.gz
llvm-c720f920094e445af23ce8e214813f57694ab716.tar.bz2
[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.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp1
1 files changed, 1 insertions, 0 deletions
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();