[PATCH] D34210: Add __has_feature(leak_sanitizer)

2017-07-10 Thread Francis Ricci via Phabricator via cfe-commits
fjricci added a comment. In https://reviews.llvm.org/D34210#804084, @smeenai wrote: > COFF supports weak externals: https://stackoverflow.com/a/11529277/382079. > Would it suffice here? Looks like it could work, thanks. https://reviews.llvm.org/D34210

[PATCH] D34210: Add __has_feature(leak_sanitizer)

2017-07-10 Thread Shoaib Meenai via Phabricator via cfe-commits
smeenai added a comment. COFF supports weak externals: https://stackoverflow.com/a/11529277/382079. Would it suffice here? https://reviews.llvm.org/D34210 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D34210: Add __has_feature(leak_sanitizer)

2017-07-10 Thread Kostya Serebryany via Phabricator via cfe-commits
kcc added a comment. In https://reviews.llvm.org/D34210#785828, @rnk wrote: > If LSan is a runtime thing, why not use weak hooks or something to detect > LSan at runtime instead of using a macro? +1 For a run-time-only feature the checking should also be run-time-only (not compile-time)

[PATCH] D34210: Add __has_feature(leak_sanitizer)

2017-06-20 Thread Reid Kleckner via Phabricator via cfe-commits
rnk added a comment. If LSan is a runtime thing, why not use weak hooks or something to detect LSan at runtime instead of using a macro? https://reviews.llvm.org/D34210 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D34210: Add __has_feature(leak_sanitizer)

2017-06-20 Thread Francis Ricci via Phabricator via cfe-commits
fjricci reclaimed this revision. fjricci added a comment. As I've looked into this further, I do think we need `has_feature(leak_sanitizer)` after all. For example, if a user program calls `pthread_create()` with a custom stack size, leak sanitizer will intercept the call to

[PATCH] D34210: Add __has_feature(leak_sanitizer)

2017-06-14 Thread Francis Ricci via Phabricator via cfe-commits
fjricci abandoned this revision. fjricci added a comment. Weak hooks do provide a good solution, abandoning for now (although it may need to be reconsidered if we get a windows LSan port up and running). https://reviews.llvm.org/D34210 ___

[PATCH] D34210: Add __has_feature(leak_sanitizer)

2017-06-14 Thread Maxim Ostapenko via Phabricator via cfe-commits
m.ostapenko added a comment. In https://reviews.llvm.org/D34210#780520, @fjricci wrote: > Currently, the way that we tell users to gate on sanitizer-specific behavior > is with `__has_feature(foo_sanitizer)`, as far as I know, it's the only way > to do so. LSan provides several API functions

[PATCH] D34210: Add __has_feature(leak_sanitizer)

2017-06-14 Thread Francis Ricci via Phabricator via cfe-commits
fjricci added a comment. Currently, the way that we tell users to gate on sanitizer-specific behavior is with `__has_feature(foo_sanitizer)`, as far as I know, it's the only way to do so. LSan provides several API functions for users, ie `__lsan_ignore_object`. If a user program wants to use

[PATCH] D34210: Add __has_feature(leak_sanitizer)

2017-06-14 Thread Kostya Serebryany via Phabricator via cfe-commits
kcc added a comment. I'm not sure about this one. standalone lsan is a link-time feature only, it doesn't change the compilation, so the argument of consistency doesn't apply. https://reviews.llvm.org/D34210 ___ cfe-commits mailing list

[PATCH] D34210: Add __has_feature(leak_sanitizer)

2017-06-14 Thread Francis Ricci via Phabricator via cfe-commits
fjricci created this revision. Stand-alone leak sanitizer builds are supported with -fsanitize=leak, adds an attribute for consistency with the rest of the sanitizer attributes. https://reviews.llvm.org/D34210 Files: lib/Lex/PPMacroExpansion.cpp test/Lexer/has_feature_leak_sanitizer.cpp