tsan: fix clang -Wall build

Clang does not like classes with virtual functions but w/o virtual dtor.
Go does not like libstdc++ (operator delete).

llvm-svn: 177267
This commit is contained in:
Dmitry Vyukov 2013-03-18 10:10:15 +00:00
parent b5d10f69e4
commit 49e462fab2
4 changed files with 14 additions and 1 deletions

View File

@ -22,7 +22,11 @@ ThreadContextBase::ThreadContextBase(u32 tid)
name[0] = '\0';
}
ThreadContextBase::~ThreadContextBase() {}
#ifndef SANITIZER_GO
ThreadContextBase::~ThreadContextBase() {
CHECK(0);
}
#endif
void ThreadContextBase::SetName(const char *new_name) {
name[0] = '\0';

View File

@ -34,6 +34,9 @@ enum ThreadStatus {
class ThreadContextBase {
public:
explicit ThreadContextBase(u32 tid);
#ifndef SANITIZER_GO // Go does not have libstdc++
virtual
#endif
~ThreadContextBase();
const u32 tid; // Thread ID. Main thread should have tid = 0.

View File

@ -419,6 +419,7 @@ struct ThreadDeadInfo {
class ThreadContext : public ThreadContextBase {
public:
explicit ThreadContext(int tid);
~ThreadContext();
ThreadState *thr;
#ifdef TSAN_GO
StackTrace creation_stack;

View File

@ -31,6 +31,11 @@ ThreadContext::ThreadContext(int tid)
, dead_info() {
}
#ifndef TSAN_GO
ThreadContext::~ThreadContext() {
}
#endif
void ThreadContext::OnDead() {
sync.Reset();
}