[compiler-rt] r344954 - [interception] Switch to _type suffix instead of _f, NFC.

Kuba Mracek via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 22 13:54:48 PDT 2018


Author: kuba.brecka
Date: Mon Oct 22 13:54:48 2018
New Revision: 344954

URL: http://llvm.org/viewvc/llvm-project?rev=344954&view=rev
Log:
[interception] Switch to _type suffix instead of _f, NFC.

Some Darwin functions have pairs like dispatch_apply and dispatch_apply_f so the added _f to interceptor types causes a clash. Let's add _type suffix instead.

Differential Revision: https://reviews.llvm.org/D53167


Modified:
    compiler-rt/trunk/lib/interception/interception.h
    compiler-rt/trunk/lib/interception/interception_linux.h

Modified: compiler-rt/trunk/lib/interception/interception.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/interception/interception.h?rev=344954&r1=344953&r2=344954&view=diff
==============================================================================
--- compiler-rt/trunk/lib/interception/interception.h (original)
+++ compiler-rt/trunk/lib/interception/interception.h Mon Oct 22 13:54:48 2018
@@ -170,7 +170,7 @@ const interpose_substitution substitutio
 #elif !SANITIZER_MAC
 # define PTR_TO_REAL(x) real_##x
 # define REAL(x) __interception::PTR_TO_REAL(x)
-# define FUNC_TYPE(x) x##_f
+# define FUNC_TYPE(x) x##_type
 
 # define DECLARE_REAL(ret_type, func, ...) \
     typedef ret_type (*FUNC_TYPE(func))(__VA_ARGS__); \

Modified: compiler-rt/trunk/lib/interception/interception_linux.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/interception/interception_linux.h?rev=344954&r1=344953&r2=344954&view=diff
==============================================================================
--- compiler-rt/trunk/lib/interception/interception_linux.h (original)
+++ compiler-rt/trunk/lib/interception/interception_linux.h Mon Oct 22 13:54:48 2018
@@ -38,7 +38,7 @@ void *GetFuncAddrVer(const char *func_na
 // Android,  Solaris and OpenBSD do not have dlvsym
 #if !SANITIZER_ANDROID && !SANITIZER_SOLARIS && !SANITIZER_OPENBSD
 #define INTERCEPT_FUNCTION_VER_LINUX_OR_FREEBSD(func, symver) \
-  (::__interception::real_##func = (func##_f)(                \
+  (::__interception::real_##func = (func##_type)(                \
        unsigned long)::__interception::GetFuncAddrVer(#func, symver))
 #else
 #define INTERCEPT_FUNCTION_VER_LINUX_OR_FREEBSD(func, symver) \




More information about the llvm-commits mailing list