]> granicus.if.org Git - llvm/commitdiff
[TableGen] Ensure that __lsan_is_turned_off isn't removed by DCE in llvm-tblgen
authorFrancis Ricci <francisjricci@gmail.com>
Mon, 11 Sep 2017 13:50:39 +0000 (13:50 +0000)
committerFrancis Ricci <francisjricci@gmail.com>
Mon, 11 Sep 2017 13:50:39 +0000 (13:50 +0000)
Summary:
Since asan is linked dynamically on Darwin, the weak interface symbol
is removed by -Wl,-dead_strip.

Reviewers: kcc, compnerd, aaron.ballman

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D37636

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312914 91177308-0d34-0410-b5e6-96231b3b80d8

utils/TableGen/TableGen.cpp

index 00d20f1df6c2740148dc940a8fc40e178c10d443..a0261c22d64774e3f79cc78e823d5aee56b723e7 100644 (file)
@@ -217,6 +217,6 @@ int main(int argc, char **argv) {
 #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 .
-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)