This is an archive of the discontinued LLVM Phabricator instance.

Provide default implementations for sanitizer interface functions
ClosedPublic

Authored by fjricci on Dec 31 2016, 9:12 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

fjricci updated this revision to Diff 82772.Dec 31 2016, 9:12 AM
fjricci retitled this revision from to Provide default implementations for sanitizer interface functions.
fjricci updated this object.
fjricci added reviewers: eugenis, samsonov, timurrrr.
fjricci added a subscriber: llvm-commits.
kcc added a subscriber: kcc.Jan 3 2017, 11:24 AM

Does this deserve a test on those platforms?

Is leak sanitizer currently supported on any platforms that don't support weak hooks? As far as I'm aware, it isn't, although I'm working on adding additional support. This could be tested by adding the stubs necessary for compilation on a platform like Darwin, but I'm not sure whether that's worth the benefits we get.

Unless the testing infra supports changing these defines at test-time, in which case it probably wouldn't be difficult.

kcc added a comment.Jan 5 2017, 12:04 PM

Ok. How about just a test (on all platforms where lsan is supported)?

fjricci added a comment.EditedJan 5 2017, 1:00 PM

The issue is that these SANITIZER_SUPPORTS_WEAK_HOOKS is true on all currently supported platforms (if it wasn't, lsan would fail to link on those platforms, making a test unnecessary anyway). But this patch is required in order to add platforms where SANITIZER_SUPPORTS_WEAK_HOOKS is false. It's also required for consistency with the existing __lsan_is_turned_off() stub.

kcc accepted this revision.Jan 5 2017, 1:21 PM
kcc added a reviewer: kcc.

LGTM

This revision is now accepted and ready to land.Jan 5 2017, 1:21 PM
This revision was automatically updated to reflect the committed changes.