[llvm] r372731 - [tblgen] Disable Leak detection for ASan/GCC and LSan/LLVM

Kamil Rytarowski via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 24 04:22:35 PDT 2019


Author: kamil
Date: Tue Sep 24 04:22:34 2019
New Revision: 372731

URL: http://llvm.org/viewvc/llvm-project?rev=372731&view=rev
Log:
[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

Modified:
    llvm/trunk/utils/TableGen/TableGen.cpp

Modified: llvm/trunk/utils/TableGen/TableGen.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/TableGen.cpp?rev=372731&r1=372730&r2=372731&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/TableGen.cpp (original)
+++ llvm/trunk/utils/TableGen/TableGen.cpp Tue Sep 24 04:22:34 2019
@@ -263,11 +263,16 @@ int main(int argc, char **argv) {
   return TableGenMain(argv[0], &LLVMTableGenMain);
 }
 
-#ifdef __has_feature
-#if __has_feature(address_sanitizer)
+#ifndef __has_feature
+#define __has_feature(x) 0
+#endif
+
+#if __has_feature(address_sanitizer) || defined(__SANITIZE_ADDRESS__) ||       \
+    __has_feature(leak_sanitizer)
+
 #include <sanitizer/lsan_interface.h>
 // 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 .
 LLVM_ATTRIBUTE_USED int __lsan_is_turned_off() { return 1; }
-#endif  // __has_feature(address_sanitizer)
-#endif  // defined(__has_feature)
+
+#endif




More information about the llvm-commits mailing list