asan: Use `#if` to test CAN_SANITIZE_LEAKS
authorRoland McGrath <mcgrathr@google.com>
Wed, 23 Sep 2020 18:41:09 +0000 (11:41 -0700)
committerRoland McGrath <mcgrathr@google.com>
Wed, 23 Sep 2020 18:59:31 +0000 (11:59 -0700)
commitc96d0cceb684fa176b51d7df5f4f8370e2c983f4
tree71ed5ce367859d5183b1545d66b1938f1d8efb4d
parent652a8f150d4903abb53697ef1762026c6f5e716c
asan: Use `#if` to test CAN_SANITIZE_LEAKS

The `if (0)` isn't necessarily optimized out so as not to create
a link-time reference to LSan runtime functions that might not
exist.  So use explicit conditional compilation instead.

Reviewed By: phosek

Differential Revision: https://reviews.llvm.org/D88173
compiler-rt/lib/asan/asan_rtl.cpp
compiler-rt/lib/lsan/lsan_common_fuchsia.cpp