[PATCH] D43879: Cleanup in sanitizer_common_interceptors.inc

Vitaly Buka via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 3 17:41:13 PST 2018


vitalybuka added inline comments.


================
Comment at: lib/sanitizer_common/sanitizer_common_interceptors.inc:4049
 
 #if SANITIZER_NETBSD
 INTERCEPTOR(int, __libc_mutex_lock, void *m) \
----------------
and we need SANITIZER_INTERCEPT_* in platform
#if SANITIZER_INTERCEPT__LIBC_MUTEX_LOCK
....


#if SANITIZER_INTERCEPT__LIBC_THR_SETCANCELSTATE
....


================
Comment at: lib/sanitizer_common/sanitizer_common_interceptors.inc:7270
 
-#if SANITIZER_NETBSD
-  COMMON_INTERCEPT_FUNCTION(__libc_mutex_lock);
-  COMMON_INTERCEPT_FUNCTION(__libc_mutex_unlock);
-  COMMON_INTERCEPT_FUNCTION(__libc_thr_setcancelstate);
-#endif
+  COMMON_MAYBE_INTERCEPT_NETBSD_ALIAS(mutex_lock);
+  COMMON_MAYBE_INTERCEPT_NETBSD_ALIAS(mutex_unlock);
----------------
krytarowski wrote:
> vitalybuka wrote:
> > for consistency it should be 
> > INIT_MUTEX_LOCK
> > INIT_MUTEX_UNLOCK
> > INIT_SET_CANCEL_STATE
> > 
> > All INIT_* macros are already MAYBE and enabled/disabled according to the platform.
> These ones are aliases specific to NetBSD libc.
> 
> How about: `INIT_NETBSD_ALIAS*` and `INIT_NETBSD_ALIAS_THR*`?
I guess the point that here we hide how (_ALIAS_) and on which platform(_NETBSD_) it works


Repository:
  rL LLVM

https://reviews.llvm.org/D43879





More information about the llvm-commits mailing list