mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 03:02:36 +01:00
[tblgen] Disable Leak detection for ASan/GCC and LSan/LLVM
Summary: Add support for sanitizing TableGen.cpp with ASan/GCC and LSan/LLVM. Reviewers: fjricci, kcc, aaron.ballman, mgorny Reviewed By: fjricci Subscribers: jakubjelinek, llvm-commits, #llvm Tags: #llvm Differential Revision: https://reviews.llvm.org/D67908 llvm-svn: 372731
This commit is contained in:
parent
056ab2b8a3
commit
26b5adf664
@ -263,11 +263,16 @@ int main(int argc, char **argv) {
|
|||||||
return TableGenMain(argv[0], &LLVMTableGenMain);
|
return TableGenMain(argv[0], &LLVMTableGenMain);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __has_feature
|
#ifndef __has_feature
|
||||||
#if __has_feature(address_sanitizer)
|
#define __has_feature(x) 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if __has_feature(address_sanitizer) || defined(__SANITIZE_ADDRESS__) || \
|
||||||
|
__has_feature(leak_sanitizer)
|
||||||
|
|
||||||
#include <sanitizer/lsan_interface.h>
|
#include <sanitizer/lsan_interface.h>
|
||||||
// Disable LeakSanitizer for this binary as it has too many leaks that are not
|
// Disable LeakSanitizer for this binary as it has too many leaks that are not
|
||||||
// very interesting to fix. See compiler-rt/include/sanitizer/lsan_interface.h .
|
// very interesting to fix. See compiler-rt/include/sanitizer/lsan_interface.h .
|
||||||
LLVM_ATTRIBUTE_USED int __lsan_is_turned_off() { return 1; }
|
LLVM_ATTRIBUTE_USED int __lsan_is_turned_off() { return 1; }
|
||||||
#endif // __has_feature(address_sanitizer)
|
|
||||||
#endif // defined(__has_feature)
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user