Index: compiler-rt/lib/hwasan/hwasan_checks.h =================================================================== --- compiler-rt/lib/hwasan/hwasan_checks.h +++ compiler-rt/lib/hwasan/hwasan_checks.h @@ -19,7 +19,7 @@ namespace __hwasan { template -__attribute__((always_inline)) static void SigTrap(uptr p) { +ALWAYS_INLINE static void SigTrap(uptr p) { #if defined(__aarch64__) (void)p; // 0x900 is added to do not interfere with the kernel use of lower values of @@ -45,7 +45,7 @@ // Version with access size which is not power of 2 template -__attribute__((always_inline)) static void SigTrap(uptr p, uptr size) { +ALWAYS_INLINE static void SigTrap(uptr p, uptr size) { #if defined(__aarch64__) register uptr x0 asm("x0") = p; register uptr x1 asm("x1") = size; @@ -62,7 +62,7 @@ // __builtin_unreachable(); } -__attribute__((always_inline, nodebug)) static bool PossiblyShortTagMatches( +ALWAYS_INLINE NODEBUG static bool PossiblyShortTagMatches( tag_t mem_tag, uptr ptr, uptr sz) { tag_t ptr_tag = GetTagFromPointer(ptr); if (ptr_tag == mem_tag) @@ -81,7 +81,7 @@ enum class AccessType { Load, Store }; template -__attribute__((always_inline, nodebug)) static void CheckAddress(uptr p) { +ALWAYS_INLINE NODEBUG static void CheckAddress(uptr p) { if (!InTaggableRegion(p)) return; uptr ptr_raw = p & ~kAddressTagMask; @@ -95,7 +95,7 @@ } template -__attribute__((always_inline, nodebug)) static void CheckAddressSized(uptr p, +ALWAYS_INLINE NODEBUG static void CheckAddressSized(uptr p, uptr sz) { if (sz == 0 || !InTaggableRegion(p)) return; Index: compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h =================================================================== --- compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h +++ compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h @@ -253,6 +253,12 @@ # define USED #endif +#if defined(__clang__) +#define NODEBUG __attribute__((nodebug)) +#else +#define NODEBUG +#endif + #if !defined(_MSC_VER) || defined(__clang__) || MSC_PREREQ(1900) # define NOEXCEPT noexcept #else