summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2014-01-15 07:59:37 +0000
committerKostya Serebryany <kcc@google.com>2014-01-15 07:59:37 +0000
commit317e2c499d9cb58df2df9bef983f2bb4107a78e8 (patch)
tree6f24f62fe888bd8277c11b1507a96c130b261823
parent4c5c99f91a8ffa3fd342801a0b49607e9ebcb8f3 (diff)
downloadbcm5719-llvm-317e2c499d9cb58df2df9bef983f2bb4107a78e8.tar.gz
bcm5719-llvm-317e2c499d9cb58df2df9bef983f2bb4107a78e8.zip
replace LeakSanitizerIsTurnedOffForTheCurrentProcess with __lsan_is_turned_off, but this time hide it under __has_feature(address_sanitizer); also include <sanitizer/lsan_interface.h>
llvm-svn: 199303
-rw-r--r--clang/utils/TableGen/TableGen.cpp12
-rw-r--r--llvm/utils/TableGen/TableGen.cpp12
2 files changed, 14 insertions, 10 deletions
diff --git a/clang/utils/TableGen/TableGen.cpp b/clang/utils/TableGen/TableGen.cpp
index 1d677e7a2a1..d94ff5937b2 100644
--- a/clang/utils/TableGen/TableGen.cpp
+++ b/clang/utils/TableGen/TableGen.cpp
@@ -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)
diff --git a/llvm/utils/TableGen/TableGen.cpp b/llvm/utils/TableGen/TableGen.cpp
index 669127c3b0b..00c3a6fd91f 100644
--- a/llvm/utils/TableGen/TableGen.cpp
+++ b/llvm/utils/TableGen/TableGen.cpp
@@ -181,9 +181,11 @@ int main(int argc, char **argv) {
return TableGenMain(argv[0], &LLVMTableGenMain);
}
-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)
OpenPOWER on IntegriCloud