summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2013-01-30 09:24:00 +0000
committerDmitry Vyukov <dvyukov@google.com>2013-01-30 09:24:00 +0000
commit5fbfafcd8c25f40508687d367182c73d633e6b89 (patch)
tree9e7da97e42ae7633164cbee927a5768bc1aa8ba2
parenta832ab1bfc0dce8afc0f7b3cb3b280aa17b9f490 (diff)
downloadbcm5719-llvm-5fbfafcd8c25f40508687d367182c73d633e6b89.tar.gz
bcm5719-llvm-5fbfafcd8c25f40508687d367182c73d633e6b89.zip
tsan: add OnFinalize() callback for frontends
llvm-svn: 173915
-rw-r--r--compiler-rt/lib/tsan/rtl/tsan_rtl.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/compiler-rt/lib/tsan/rtl/tsan_rtl.cc b/compiler-rt/lib/tsan/rtl/tsan_rtl.cc
index b17c326da49..0c520305e62 100644
--- a/compiler-rt/lib/tsan/rtl/tsan_rtl.cc
+++ b/compiler-rt/lib/tsan/rtl/tsan_rtl.cc
@@ -37,6 +37,13 @@ THREADLOCAL char cur_thread_placeholder[sizeof(ThreadState)] ALIGNED(64);
#endif
static char ctx_placeholder[sizeof(Context)] ALIGNED(64);
+// Can be overriden by a front-end.
+#ifndef TSAN_GO
+bool WEAK OnFinalize(bool failed) {
+ return failed;
+}
+#endif
+
static Context *ctx;
Context *CTX() {
return ctx;
@@ -277,6 +284,10 @@ int Finalize(ThreadState *thr) {
ctx->nmissed_expected);
}
+#ifndef TSAN_GO
+ failed = OnFinalize(failed);
+#endif
+
StatAggregate(ctx->stat, thr->stat);
StatOutput(ctx->stat);
return failed ? flags()->exitcode : 0;
OpenPOWER on IntegriCloud