[compiler-rt] r177143 - [Sanitizer] Build sanitizer_common tests w/o RTTI. Move ThreadRegistry class members below methods.

Alexey Samsonov samsonov at google.com
Fri Mar 15 00:08:52 PDT 2013


Author: samsonov
Date: Fri Mar 15 02:08:52 2013
New Revision: 177143

URL: http://llvm.org/viewvc/llvm-project?rev=177143&view=rev
Log:
[Sanitizer] Build sanitizer_common tests w/o RTTI. Move ThreadRegistry class members below methods.

Modified:
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_thread_registry.h
    compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txt

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=177143&r1=177142&r2=177143&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_thread_registry.h (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_thread_registry.h Fri Mar 15 02:08:52 2013
@@ -73,24 +73,6 @@ class ThreadContextBase {
 typedef ThreadContextBase* (*ThreadContextFactory)(u32 tid);
 
 class ThreadRegistry {
- private:
-  const ThreadContextFactory context_factory_;
-  const u32 max_threads_;
-  const u32 thread_quarantine_size_;
-
-  BlockingMutex mtx_;
-
-  u32 n_contexts_;      // Number of created thread contexts,
-                        // at most max_threads_.
-  u64 total_threads_;   // Total number of created threads. May be greater than
-                        // max_threads_ if contexts were reused.
-  uptr alive_threads_;  // Created or running.
-  uptr max_alive_threads_;
-  uptr running_threads_;
-
-  ThreadContextBase **threads_;  // Array of thread contexts is leaked.
-  IntrusiveList<ThreadContextBase> dead_threads_;
-
  public:
   static const u32 kUnknownTid;
 
@@ -130,6 +112,24 @@ class ThreadRegistry {
   void JoinThread(u32 tid, void *arg);
   void FinishThread(u32 tid);
   void StartThread(u32 tid, uptr os_id, void *arg);
+
+ private:
+  const ThreadContextFactory context_factory_;
+  const u32 max_threads_;
+  const u32 thread_quarantine_size_;
+
+  BlockingMutex mtx_;
+
+  u32 n_contexts_;      // Number of created thread contexts,
+                        // at most max_threads_.
+  u64 total_threads_;   // Total number of created threads. May be greater than
+                        // max_threads_ if contexts were reused.
+  uptr alive_threads_;  // Created or running.
+  uptr max_alive_threads_;
+  uptr running_threads_;
+
+  ThreadContextBase **threads_;  // Array of thread contexts is leaked.
+  IntrusiveList<ThreadContextBase> dead_threads_;
 };
 
 typedef GenericScopedLock<ThreadRegistry> ThreadRegistryLock;

Modified: compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txt?rev=177143&r1=177142&r2=177143&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txt Fri Mar 15 02:08:52 2013
@@ -56,7 +56,9 @@ macro(add_sanitizer_tests_for_arch arch)
                             -I${COMPILER_RT_SOURCE_DIR}/include
                             -I${COMPILER_RT_SOURCE_DIR}/lib
                             -I${COMPILER_RT_SOURCE_DIR}/lib/sanitizer_common
-                            -O2 -g -Wall -Werror -Werror=sign-compare ${TARGET_FLAGS})
+                            -DGTEST_HAS_RTTI=0
+                            -O2 -g -fno-rtti
+                            -Wall -Werror -Werror=sign-compare ${TARGET_FLAGS})
   set(SANITIZER_TEST_LINK_FLAGS -lstdc++ -lpthread -ldl ${TARGET_FLAGS})
   set(SANITIZER_TEST_OBJECTS)
   foreach(source ${SANITIZER_TEST_SOURCES})





More information about the llvm-commits mailing list