daniel-levin updated this revision to Diff 351709.

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D104176/new/

https://reviews.llvm.org/D104176

Files:
  libunwind/src/libunwind.cpp


Index: libunwind/src/libunwind.cpp
===================================================================
--- libunwind/src/libunwind.cpp
+++ libunwind/src/libunwind.cpp
@@ -16,15 +16,13 @@
 
 #include <stdlib.h>
 
-#if defined(__has_feature)
-#define has_asan_portable __has_feature(address_sanitizer)
-#elif defined(__SANITIZE_ADDRESS__)
-#define has_asan_portable __SANITIZE_ADDRESS__
-#else
-#define has_asan_portable 0
+// Define the __has_feature extension for compilers that do not support it so 
that
+// we can later check for the presence of ASan in a compiler-neutral way.
+#if !defined(__has_feature)
+#define __has_feature(feature) 0
 #endif
 
-#if has_asan_portable
+#if __has__feature(address_sanitizer) || defined(__SANITIZE_ADDRESS__)
 #include <sanitizer/asan_interface.h>
 #endif
 
@@ -195,7 +193,7 @@
 /// Resume execution at cursor position (aka longjump).
 _LIBUNWIND_HIDDEN int __unw_resume(unw_cursor_t *cursor) {
   _LIBUNWIND_TRACE_API("__unw_resume(cursor=%p)", static_cast<void *>(cursor));
-#if has_asan_portable
+#if __has__feature(address_sanitizer) || defined(__SANITIZE_ADDRESS__)
   // Inform the ASan runtime that now might be a good time to clean stuff up.
   __asan_handle_no_return();
 #endif


Index: libunwind/src/libunwind.cpp
===================================================================
--- libunwind/src/libunwind.cpp
+++ libunwind/src/libunwind.cpp
@@ -16,15 +16,13 @@
 
 #include <stdlib.h>
 
-#if defined(__has_feature)
-#define has_asan_portable __has_feature(address_sanitizer)
-#elif defined(__SANITIZE_ADDRESS__)
-#define has_asan_portable __SANITIZE_ADDRESS__
-#else
-#define has_asan_portable 0
+// Define the __has_feature extension for compilers that do not support it so that
+// we can later check for the presence of ASan in a compiler-neutral way.
+#if !defined(__has_feature)
+#define __has_feature(feature) 0
 #endif
 
-#if has_asan_portable
+#if __has__feature(address_sanitizer) || defined(__SANITIZE_ADDRESS__)
 #include <sanitizer/asan_interface.h>
 #endif
 
@@ -195,7 +193,7 @@
 /// Resume execution at cursor position (aka longjump).
 _LIBUNWIND_HIDDEN int __unw_resume(unw_cursor_t *cursor) {
   _LIBUNWIND_TRACE_API("__unw_resume(cursor=%p)", static_cast<void *>(cursor));
-#if has_asan_portable
+#if __has__feature(address_sanitizer) || defined(__SANITIZE_ADDRESS__)
   // Inform the ASan runtime that now might be a good time to clean stuff up.
   __asan_handle_no_return();
 #endif
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to