summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2013-10-14 06:31:03 +0000
committerDmitry Vyukov <dvyukov@google.com>2013-10-14 06:31:03 +0000
commit6a135be19fa0cc594fd61f9caf3c0be2b7f1466e (patch)
tree01e3076a3409aa3769bc5cef8ada8790f1d063a2
parent3e0b8ff07e86e0858e016d187d842e97aea2255d (diff)
downloadcompiler-rt-6a135be19fa0cc594fd61f9caf3c0be2b7f1466e.tar.gz
compiler-rt-6a135be19fa0cc594fd61f9caf3c0be2b7f1466e.tar.bz2
compiler-rt-6a135be19fa0cc594fd61f9caf3c0be2b7f1466e.tar.xz
tsan: allow to override OnFinalize() in front-ends that does not support weak functions (Go)
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@192569 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/tsan/rtl/tsan_rtl.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/tsan/rtl/tsan_rtl.cc b/lib/tsan/rtl/tsan_rtl.cc
index 9ecfd590..1ce99172 100644
--- a/lib/tsan/rtl/tsan_rtl.cc
+++ b/lib/tsan/rtl/tsan_rtl.cc
@@ -39,9 +39,13 @@ THREADLOCAL char cur_thread_placeholder[sizeof(ThreadState)] ALIGNED(64);
static char ctx_placeholder[sizeof(Context)] ALIGNED(64);
// Can be overriden by a front-end.
-bool CPP_WEAK OnFinalize(bool failed) {
+#ifdef TSAN_EXTERNAL_HOOKS
+bool OnFinalize(bool failed);
+#else
+bool WEAK OnFinalize(bool failed) {
return failed;
}
+#endif
static Context *ctx;
Context *CTX() {