[compiler-rt] r360958 - [sanitizer] Don't generate "failed to intercept" constants for each function

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Thu May 16 16:46:15 PDT 2019


Author: vitalybuka
Date: Thu May 16 16:46:15 2019
New Revision: 360958

URL: http://llvm.org/viewvc/llvm-project?rev=360958&view=rev
Log:
[sanitizer] Don't generate "failed to intercept" constants for each function

Modified:
    compiler-rt/trunk/lib/asan/asan_interceptors.h
    compiler-rt/trunk/lib/msan/msan_interceptors.cc

Modified: compiler-rt/trunk/lib/asan/asan_interceptors.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_interceptors.h?rev=360958&r1=360957&r2=360958&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_interceptors.h (original)
+++ compiler-rt/trunk/lib/asan/asan_interceptors.h Thu May 16 16:46:15 2019
@@ -120,16 +120,16 @@ DECLARE_REAL(uptr, strnlen, const char *
 DECLARE_REAL(char*, strstr, const char *s1, const char *s2)
 
 #if !SANITIZER_MAC
-#define ASAN_INTERCEPT_FUNC(name)                                        \
-  do {                                                                   \
-    if (!INTERCEPT_FUNCTION(name))                                       \
-      VReport(1, "AddressSanitizer: failed to intercept '" #name "'\n"); \
+#define ASAN_INTERCEPT_FUNC(name)                                         \
+  do {                                                                    \
+    if (!INTERCEPT_FUNCTION(name))                                        \
+      VReport(1, "AddressSanitizer: failed to intercept '%s'\n'", #name); \
   } while (0)
-#define ASAN_INTERCEPT_FUNC_VER(name, ver)                                     \
-  do {                                                                         \
-    if (!INTERCEPT_FUNCTION_VER(name, ver))                                    \
-      VReport(                                                                 \
-          1, "AddressSanitizer: failed to intercept '" #name "@@" #ver "'\n"); \
+#define ASAN_INTERCEPT_FUNC_VER(name, ver)                                  \
+  do {                                                                      \
+    if (!INTERCEPT_FUNCTION_VER(name, ver))                                 \
+      VReport(1, "AddressSanitizer: failed to intercept '%s@@%s'\n", #name, \
+              #ver);                                                        \
   } while (0)
 #else
 // OS X interceptors don't need to be initialized with INTERCEPT_FUNCTION.

Modified: compiler-rt/trunk/lib/msan/msan_interceptors.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/msan/msan_interceptors.cc?rev=360958&r1=360957&r2=360958&view=diff
==============================================================================
--- compiler-rt/trunk/lib/msan/msan_interceptors.cc (original)
+++ compiler-rt/trunk/lib/msan/msan_interceptors.cc Thu May 16 16:46:15 2019
@@ -1246,17 +1246,17 @@ int OnExit() {
       CHECK_UNPOISONED_0(x, n);                                 \
   } while (0)
 
-#define MSAN_INTERCEPT_FUNC(name)                                       \
-  do {                                                                  \
-    if (!INTERCEPT_FUNCTION(name))                                      \
-      VReport(1, "MemorySanitizer: failed to intercept '" #name "'\n"); \
+#define MSAN_INTERCEPT_FUNC(name)                                        \
+  do {                                                                   \
+    if (!INTERCEPT_FUNCTION(name))                                       \
+      VReport(1, "MemorySanitizer: failed to intercept '%s'\n'", #name); \
   } while (0)
 
-#define MSAN_INTERCEPT_FUNC_VER(name, ver)                                    \
-  do {                                                                        \
-    if (!INTERCEPT_FUNCTION_VER(name, ver))                                   \
-      VReport(                                                                \
-          1, "MemorySanitizer: failed to intercept '" #name "@@" #ver "'\n"); \
+#define MSAN_INTERCEPT_FUNC_VER(name, ver)                                 \
+  do {                                                                     \
+    if (!INTERCEPT_FUNCTION_VER(name, ver))                                \
+      VReport(1, "MemorySanitizer: failed to intercept '%s@@%s'\n", #name, \
+              #ver);                                                       \
   } while (0)
 
 #define COMMON_INTERCEPT_FUNCTION(name) MSAN_INTERCEPT_FUNC(name)




More information about the llvm-commits mailing list