diff options
-rw-r--r-- | compiler-rt/lib/tsan/rtl/tsan_rtl.cc | 11 |
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; |