From f03e719f23c85d2500c5d34f4f39cbfe664ed19c Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Wed, 15 Oct 2014 05:38:49 +0000 Subject: [PATCH] tsan: remove dead code llvm-svn: 219779 --- compiler-rt/lib/tsan/rtl/tsan_interceptors.cc | 60 ------------------- 1 file changed, 60 deletions(-) diff --git a/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc b/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc index 6a38dafdbb9d..0fbd77534b10 100644 --- a/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc +++ b/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc @@ -284,66 +284,6 @@ TSAN_INTERCEPTOR(int, nanosleep, void *req, void *rem) { return res; } -/* -class AtExitContext { - public: - AtExitContext() - : mtx_(MutexTypeAtExit, StatMtxAtExit) - , stack_(MBlockAtExit) { - } - - typedef void(*atexit_cb_t)(); - - int atexit(ThreadState *thr, uptr pc, bool is_on_exit, - atexit_cb_t f, void *arg, void *dso) { - Lock l(&mtx_); - Release(thr, pc, (uptr)this); - atexit_t *a = stack_.PushBack(); - a->cb = f; - a->arg = arg; - a->dso = dso; - a->is_on_exit = is_on_exit; - return 0; - } - - void exit(ThreadState *thr, uptr pc) { - for (;;) { - atexit_t a = {}; - { - Lock l(&mtx_); - if (stack_.Size() != 0) { - a = stack_[stack_.Size() - 1]; - stack_.PopBack(); - Acquire(thr, pc, (uptr)this); - } - } - if (a.cb == 0) - break; - VPrintf(2, "#%d: executing atexit func %p(%p) dso=%p\n", - thr->tid, a.cb, a.arg, a.dso); - if (a.is_on_exit) - ((void(*)(int status, void *arg))a.cb)(0, a.arg); - else - ((void(*)(void *arg, void *dso))a.cb)(a.arg, a.dso); - } - } - - private: - struct atexit_t { - atexit_cb_t cb; - void *arg; - void *dso; - bool is_on_exit; - }; - - static const int kMaxAtExit = 1024; - Mutex mtx_; - Vector stack_; -}; - -static AtExitContext *atexit_ctx; -*/ - // The sole reason tsan wraps atexit callbacks is to establish synchronization // between callback setup and callback execution. struct AtExitCtx {