This is an archive of the discontinued LLVM Phabricator instance.

asan: Use `#if` to test CAN_SANITIZE_LEAKS
ClosedPublic

Authored by mcgrathr on Sep 23 2020, 11:30 AM.

Details

Summary

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.

Diff Detail

Event Timeline

mcgrathr created this revision.Sep 23 2020, 11:30 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 23 2020, 11:30 AM
Herald added a subscriber: Restricted Project. · View Herald Transcript
mcgrathr requested review of this revision.Sep 23 2020, 11:30 AM
mcgrathr updated this revision to Diff 293824.Sep 23 2020, 11:41 AM

fix comment typo in earlier change

phosek accepted this revision.Sep 23 2020, 11:56 AM

LGTM

This revision is now accepted and ready to land.Sep 23 2020, 11:56 AM
This revision was landed with ongoing or failed builds.Sep 23 2020, 11:59 AM
This revision was automatically updated to reflect the committed changes.
kcc added a subscriber: kcc.Sep 23 2020, 12:23 PM

a drive-by comment -- I would really appreciate *not* adding any new uses of C preprocessor.