mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-12 22:14:54 +03:00
Add LeakSanitizer support with -fsanitize=leak
(#4005)
* Add LeakSanitizer support * Windows and FreeBSD do not support LSan yet * Test LLVM >= 10 only with LSan
This commit is contained in:
parent
a2ce3f31b2
commit
3b9665bac6
7 changed files with 40 additions and 2 deletions
|
@ -457,6 +457,9 @@ void ArgsBuilder::addProfileRuntimeLinkFlags(const llvm::Triple &triple) {
|
|||
void ArgsBuilder::addSanitizers(const llvm::Triple &triple) {
|
||||
if (opts::isSanitizerEnabled(opts::AddressSanitizer)) {
|
||||
addSanitizerLinkFlags(triple, "asan", "-fsanitize=address");
|
||||
} else if (opts::isSanitizerEnabled(opts::LeakSanitizer)) {
|
||||
// If ASan is enabled, it includes LSan. So only add LSan link flags if ASan is _not_ enabled already.
|
||||
addSanitizerLinkFlags(triple, "lsan", "-fsanitize=leak");
|
||||
}
|
||||
|
||||
if (opts::isSanitizerEnabled(opts::FuzzSanitizer)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue