[compiler-rt] 32a425e - [Sanitizer][Darwin][NFC] Small SANITIZER_APPLE cleanup
Julian Lettner via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 15 16:31:40 PDT 2022
Author: Julian Lettner
Date: 2022-07-15T16:31:35-07:00
New Revision: 32a425ec0c10ebb0b0cb9a0c1cdf101e62c1b43e
URL: https://github.com/llvm/llvm-project/commit/32a425ec0c10ebb0b0cb9a0c1cdf101e62c1b43e
DIFF: https://github.com/llvm/llvm-project/commit/32a425ec0c10ebb0b0cb9a0c1cdf101e62c1b43e.diff
LOG: [Sanitizer][Darwin][NFC] Small SANITIZER_APPLE cleanup
We introduced `SANITIZER_APPLE` here: https://reviews.llvm.org/D126263
Added:
Modified:
compiler-rt/lib/ubsan/ubsan_value.cpp
Removed:
################################################################################
diff --git a/compiler-rt/lib/ubsan/ubsan_value.cpp b/compiler-rt/lib/ubsan/ubsan_value.cpp
index 5a93a0d7fc2d..dc61e5b939d9 100644
--- a/compiler-rt/lib/ubsan/ubsan_value.cpp
+++ b/compiler-rt/lib/ubsan/ubsan_value.cpp
@@ -18,9 +18,7 @@
#include "sanitizer_common/sanitizer_libc.h"
#include "sanitizer_common/sanitizer_mutex.h"
-// TODO(dliew): Prefer '__APPLE__' here over 'SANITIZER_APPLE', as the latter is
-// unclear. rdar://58124919 tracks using a more obviously portable guard.
-#if defined(__APPLE__)
+#if SANITIZER_APPLE
#include <dlfcn.h>
#endif
@@ -29,7 +27,7 @@ using namespace __ubsan;
typedef const char *(*ObjCGetClassNameTy)(void *);
const char *__ubsan::getObjCClassName(ValueHandle Pointer) {
-#if defined(__APPLE__)
+#if SANITIZER_APPLE
// We need to query the ObjC runtime for some information, but do not want
// to introduce a static dependency from the ubsan runtime onto ObjC. Try to
// grab a handle to the ObjC runtime used by the process.
More information about the llvm-commits
mailing list