[libc-commits] [libc] 4e5d64e - [NFC][libc] Detect HWASAN support macro

Vitaly Buka via libc-commits libc-commits at lists.llvm.org
Thu Aug 18 10:19:26 PDT 2022


Author: Vitaly Buka
Date: 2022-08-18T10:19:18-07:00
New Revision: 4e5d64e83e9c051193afc42bff708269508cb04f

URL: https://github.com/llvm/llvm-project/commit/4e5d64e83e9c051193afc42bff708269508cb04f
DIFF: https://github.com/llvm/llvm-project/commit/4e5d64e83e9c051193afc42bff708269508cb04f.diff

LOG: [NFC][libc] Detect HWASAN support macro

Added: 
    

Modified: 
    libc/src/__support/sanitizer.h

Removed: 
    


################################################################################
diff  --git a/libc/src/__support/sanitizer.h b/libc/src/__support/sanitizer.h
index e7ae05f070b5f..509109a1c694d 100644
--- a/libc/src/__support/sanitizer.h
+++ b/libc/src/__support/sanitizer.h
@@ -42,6 +42,13 @@
 #define LLVM_LIBC_HAVE_ADDRESS_SANITIZER 1
 #endif
 
+// HWAddressSanitizer (HWASan) is a fast, low memory overhead error detector.
+#ifdef LLVM_LIBC_HAVE_HWADDRESS_SANITIZER
+#error "LLVM_LIBC_HAVE_HWADDRESS_SANITIZER cannot be directly set."
+#elif LLVM_LIBC_HAVE_FEATURE(hwaddress_sanitizer)
+#define LLVM_LIBC_HAVE_HWADDRESS_SANITIZER 1
+#endif
+
 #if LLVM_LIBC_HAVE_MEMORY_SANITIZER
 #include <sanitizer/msan_interface.h>
 #define SANITIZER_MEMORY_INITIALIZED(addr, size) __msan_unpoison(addr, size)


        


More information about the libc-commits mailing list