tsan: add OnFinalize() callback for frontends

llvm-svn: 173915
This commit is contained in:
Dmitry Vyukov 2013-01-30 09:24:00 +00:00
parent a832ab1bfc
commit 5fbfafcd8c
1 changed files with 11 additions and 0 deletions

View File

@ -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;