r199303 - replace LeakSanitizerIsTurnedOffForTheCurrentProcess with __lsan_is_turned_off, but this time hide it under __has_feature(address_sanitizer); also include <sanitizer/lsan_interface.h>
Kostya Serebryany
kcc at google.com
Tue Jan 14 23:59:37 PST 2014
Author: kcc
Date: Wed Jan 15 01:59:37 2014
New Revision: 199303
URL: http://llvm.org/viewvc/llvm-project?rev=199303&view=rev
Log:
replace LeakSanitizerIsTurnedOffForTheCurrentProcess with __lsan_is_turned_off, but this time hide it under __has_feature(address_sanitizer); also include <sanitizer/lsan_interface.h>
Modified:
cfe/trunk/utils/TableGen/TableGen.cpp
Modified: cfe/trunk/utils/TableGen/TableGen.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/TableGen/TableGen.cpp?rev=199303&r1=199302&r2=199303&view=diff
==============================================================================
--- cfe/trunk/utils/TableGen/TableGen.cpp (original)
+++ cfe/trunk/utils/TableGen/TableGen.cpp Wed Jan 15 01:59:37 2014
@@ -264,9 +264,11 @@ int main(int argc, char **argv) {
return TableGenMain(argv[0], &ClangTableGenMain);
}
-extern "C" {
+#ifdef __has_feature
+#if __has_feature(address_sanitizer)
+#include <sanitizer/lsan_interface.h>
// Disable LeakSanitizer for this binary as it has too many leaks that are not
-// very interesting to fix. LeakSanitizerIsTurnedOffForTheCurrentProcess is
-// explained in compiler-rt/include/sanitizer/lsan_interface.h
-int LeakSanitizerIsTurnedOffForTheCurrentProcess() { return 1; }
-} // extern "C"
+// very interesting to fix. See compiler-rt/include/sanitizer/lsan_interface.h .
+int __lsan_is_turned_off() { return 1; }
+#endif // __has_feature(address_sanitizer)
+#endif // defined(__has_feature)
More information about the cfe-commits
mailing list