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
|
#endif
|
||||||
static char ctx_placeholder[sizeof(Context)] ALIGNED(64);
|
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;
|
static Context *ctx;
|
||||||
Context *CTX() {
|
Context *CTX() {
|
||||||
return ctx;
|
return ctx;
|
||||||
|
@ -277,6 +284,10 @@ int Finalize(ThreadState *thr) {
|
||||||
ctx->nmissed_expected);
|
ctx->nmissed_expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef TSAN_GO
|
||||||
|
failed = OnFinalize(failed);
|
||||||
|
#endif
|
||||||
|
|
||||||
StatAggregate(ctx->stat, thr->stat);
|
StatAggregate(ctx->stat, thr->stat);
|
||||||
StatOutput(ctx->stat);
|
StatOutput(ctx->stat);
|
||||||
return failed ? flags()->exitcode : 0;
|
return failed ? flags()->exitcode : 0;
|
||||||
|
|
Loading…
Reference in New Issue