summaryrefslogtreecommitdiffstats
path: root/compiler-rt
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2013-01-30 09:46:53 +0000
committerDmitry Vyukov <dvyukov@google.com>2013-01-30 09:46:53 +0000
commitd6b9348bf350a9f0ea66d333193fc728ba899b60 (patch)
tree5be084fc5b22a7f1d35365e180dd2fdbe3bd9e51 /compiler-rt
parent7b038a23819c391d0ba649db8755d3da5cda9ec2 (diff)
downloadbcm5719-llvm-d6b9348bf350a9f0ea66d333193fc728ba899b60.tar.gz
bcm5719-llvm-d6b9348bf350a9f0ea66d333193fc728ba899b60.zip
tsan: introduce a helped macro CPP_WEAK (Go linker does not support weak symbols)
llvm-svn: 173917
Diffstat (limited to 'compiler-rt')
-rw-r--r--compiler-rt/lib/tsan/rtl/tsan_defs.h3
-rw-r--r--compiler-rt/lib/tsan/rtl/tsan_rtl.cc6
2 files changed, 4 insertions, 5 deletions
diff --git a/compiler-rt/lib/tsan/rtl/tsan_defs.h b/compiler-rt/lib/tsan/rtl/tsan_defs.h
index e0c04733f0a..125458afd11 100644
--- a/compiler-rt/lib/tsan/rtl/tsan_defs.h
+++ b/compiler-rt/lib/tsan/rtl/tsan_defs.h
@@ -28,10 +28,13 @@ namespace __tsan {
const bool kGoMode = true;
const bool kCppMode = false;
const char *const kTsanOptionsEnv = "GORACE";
+#define CPP_WEAK WEAK
#else
const bool kGoMode = false;
const bool kCppMode = true;
const char *const kTsanOptionsEnv = "TSAN_OPTIONS";
+// Go linker does not support weak symbols.
+#define CPP_WEAK
#endif
const int kTidBits = 13;
diff --git a/compiler-rt/lib/tsan/rtl/tsan_rtl.cc b/compiler-rt/lib/tsan/rtl/tsan_rtl.cc
index 0c520305e62..d81f44254d3 100644
--- a/compiler-rt/lib/tsan/rtl/tsan_rtl.cc
+++ b/compiler-rt/lib/tsan/rtl/tsan_rtl.cc
@@ -38,11 +38,9 @@ THREADLOCAL char cur_thread_placeholder[sizeof(ThreadState)] ALIGNED(64);
static char ctx_placeholder[sizeof(Context)] ALIGNED(64);
// Can be overriden by a front-end.
-#ifndef TSAN_GO
-bool WEAK OnFinalize(bool failed) {
+bool CPP_WEAK OnFinalize(bool failed) {
return failed;
}
-#endif
static Context *ctx;
Context *CTX() {
@@ -284,9 +282,7 @@ int Finalize(ThreadState *thr) {
ctx->nmissed_expected);
}
-#ifndef TSAN_GO
failed = OnFinalize(failed);
-#endif
StatAggregate(ctx->stat, thr->stat);
StatOutput(ctx->stat);
OpenPOWER on IntegriCloud