forked from OSchip/llvm-project
tsan: add OnFinalize() callback for frontends
llvm-svn: 173915
This commit is contained in:
parent
a832ab1bfc
commit
5fbfafcd8c
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue