[libcxx-commits] [PATCH] D104176: [libunwind] Define and use portable macro for checking for presence of ASAN

Saleem Abdulrasool via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sat Jun 12 09:09:46 PDT 2021


compnerd requested changes to this revision.
compnerd added inline comments.
This revision now requires changes to proceed.


================
Comment at: libunwind/src/libunwind.cpp:25
+#define has_asan_portable 0
+#endif
+
----------------
I think that I would rather see this as:

```
#if !defined(__has_feature)
#define __has_feature(feature) 0
#endif
```

Then you can use `# if __has_feature(address_sanitizer) || defined(__SANITIZE_ADDRESS__)` below.

That along with a comment would be sufficient.  The GCC check would still be insufficient as it doesn't cover KASAN, but I don't believe that GCC supports that currently.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104176



More information about the libcxx-commits mailing list