[compiler-rt] r177267 - tsan: fix clang -Wall build
Dmitry Vyukov
dvyukov at google.com
Mon Mar 18 03:10:16 PDT 2013
Author: dvyukov
Date: Mon Mar 18 05:10:15 2013
New Revision: 177267
URL: http://llvm.org/viewvc/llvm-project?rev=177267&view=rev
Log:
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).
Modified:
compiler-rt/trunk/lib/sanitizer_common/sanitizer_thread_registry.cc
compiler-rt/trunk/lib/sanitizer_common/sanitizer_thread_registry.h
compiler-rt/trunk/lib/tsan/rtl/tsan_rtl.h
compiler-rt/trunk/lib/tsan/rtl/tsan_rtl_thread.cc
Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_thread_registry.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_thread_registry.cc?rev=177267&r1=177266&r2=177267&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_thread_registry.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_thread_registry.cc Mon Mar 18 05:10:15 2013
@@ -22,7 +22,11 @@ ThreadContextBase::ThreadContextBase(u32
name[0] = '\0';
}
-ThreadContextBase::~ThreadContextBase() {}
+#ifndef SANITIZER_GO
+ThreadContextBase::~ThreadContextBase() {
+ CHECK(0);
+}
+#endif
void ThreadContextBase::SetName(const char *new_name) {
name[0] = '\0';
Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_thread_registry.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_thread_registry.h?rev=177267&r1=177266&r2=177267&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_thread_registry.h (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_thread_registry.h Mon Mar 18 05:10:15 2013
@@ -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.
Modified: compiler-rt/trunk/lib/tsan/rtl/tsan_rtl.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_rtl.h?rev=177267&r1=177266&r2=177267&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/rtl/tsan_rtl.h (original)
+++ compiler-rt/trunk/lib/tsan/rtl/tsan_rtl.h Mon Mar 18 05:10:15 2013
@@ -419,6 +419,7 @@ struct ThreadDeadInfo {
class ThreadContext : public ThreadContextBase {
public:
explicit ThreadContext(int tid);
+ ~ThreadContext();
ThreadState *thr;
#ifdef TSAN_GO
StackTrace creation_stack;
Modified: compiler-rt/trunk/lib/tsan/rtl/tsan_rtl_thread.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_rtl_thread.cc?rev=177267&r1=177266&r2=177267&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/rtl/tsan_rtl_thread.cc (original)
+++ compiler-rt/trunk/lib/tsan/rtl/tsan_rtl_thread.cc Mon Mar 18 05:10:15 2013
@@ -31,6 +31,11 @@ ThreadContext::ThreadContext(int tid)
, dead_info() {
}
+#ifndef TSAN_GO
+ThreadContext::~ThreadContext() {
+}
+#endif
+
void ThreadContext::OnDead() {
sync.Reset();
}
More information about the llvm-commits
mailing list