summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/interception/interception_linux.h
diff options
context:
space:
mode:
authorJulian Lettner <jlettner@apple.com>2019-04-26 17:29:22 +0000
committerJulian Lettner <jlettner@apple.com>2019-04-26 17:29:22 +0000
commitaebd3014a5957029ada761109e6d5e1a90d67e18 (patch)
treecafad8754471d98f33c6402dda6bc9af0e507855 /compiler-rt/lib/interception/interception_linux.h
parentc29db2d83ed57d74d1f9987324e3d6ef112a8ed3 (diff)
downloadbcm5719-llvm-aebd3014a5957029ada761109e6d5e1a90d67e18.tar.gz
bcm5719-llvm-aebd3014a5957029ada761109e6d5e1a90d67e18.zip
[NFC][Sanitizer] Change "return type" of INTERCEPT_FUNCTION to void
This temporary change tells us about all the places where the return value of the INTERCEPT_FUNCTION macro is actually used. In the next patch I will cleanup the macro and remove GetRealFuncAddress. Reviewed By: vitalybuka Differential Revision: https://reviews.llvm.org/D61145 llvm-svn: 359325
Diffstat (limited to 'compiler-rt/lib/interception/interception_linux.h')
-rw-r--r--compiler-rt/lib/interception/interception_linux.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/compiler-rt/lib/interception/interception_linux.h b/compiler-rt/lib/interception/interception_linux.h
index 4c60bd88090..abef9c9e65a 100644
--- a/compiler-rt/lib/interception/interception_linux.h
+++ b/compiler-rt/lib/interception/interception_linux.h
@@ -30,16 +30,18 @@ void *GetFuncAddrVer(const char *name, const char *ver);
} // namespace __interception
#define INTERCEPT_FUNCTION_LINUX_OR_FREEBSD(func) \
- ::__interception::GetRealFunctionAddress( \
+ do { ::__interception::GetRealFunctionAddress( \
#func, (::__interception::uptr *)&__interception::PTR_TO_REAL(func), \
(::__interception::uptr) & (func), \
- (::__interception::uptr) & WRAP(func))
+ (::__interception::uptr) & WRAP(func)); \
+ } while (0) // TODO(yln): temporarily make macro void.
// 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##_type)( \
- unsigned long)::__interception::GetFuncAddrVer(#func, symver))
+ do { (::__interception::real_##func = (func##_type)( \
+ unsigned long)::__interception::GetFuncAddrVer(#func, symver)); \
+ } while (0)
#else
#define INTERCEPT_FUNCTION_VER_LINUX_OR_FREEBSD(func, symver) \
INTERCEPT_FUNCTION_LINUX_OR_FREEBSD(func)
OpenPOWER on IntegriCloud