[compiler-rt] r173915 - tsan: add OnFinalize() callback for frontends
Dmitry Vyukov
dvyukov at google.com
Wed Jan 30 01:24:00 PST 2013
Author: dvyukov
Date: Wed Jan 30 03:24:00 2013
New Revision: 173915
URL: http://llvm.org/viewvc/llvm-project?rev=173915&view=rev
Log:
tsan: add OnFinalize() callback for frontends
Modified:
compiler-rt/trunk/lib/tsan/rtl/tsan_rtl.cc
Modified: compiler-rt/trunk/lib/tsan/rtl/tsan_rtl.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_rtl.cc?rev=173915&r1=173914&r2=173915&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/rtl/tsan_rtl.cc (original)
+++ compiler-rt/trunk/lib/tsan/rtl/tsan_rtl.cc Wed Jan 30 03:24:00 2013
@@ -37,6 +37,13 @@ THREADLOCAL char cur_thread_placeholder[
#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;
More information about the llvm-commits
mailing list