[llvm-commits] [llvm] r116909 - in /llvm/trunk/lib/System: RWMutex.cpp Win32/ThreadLocal.inc

NAKAMURA Takumi geek4civic at gmail.com
Tue Oct 19 21:05:29 PDT 2010


Author: chapuni
Date: Tue Oct 19 23:05:29 2010
New Revision: 116909

URL: http://llvm.org/viewvc/llvm-project?rev=116909&view=rev
Log:
Add ATTRIBUTE_UNUSED for -Asserts.

Modified:
    llvm/trunk/lib/System/RWMutex.cpp
    llvm/trunk/lib/System/Win32/ThreadLocal.inc

Modified: llvm/trunk/lib/System/RWMutex.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/System/RWMutex.cpp?rev=116909&r1=116908&r2=116909&view=diff
==============================================================================
--- llvm/trunk/lib/System/RWMutex.cpp (original)
+++ llvm/trunk/lib/System/RWMutex.cpp Tue Oct 19 23:05:29 2010
@@ -12,6 +12,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "llvm/Config/config.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/System/RWMutex.h"
 #include <cstring>
 
@@ -72,8 +73,7 @@
 #endif
 
     // Initialize the rwlock
-    int errorcode = pthread_rwlock_init(rwlock, NULL);
-    (void)errorcode;
+    int ATTRIBUTE_UNUSED errorcode = pthread_rwlock_init(rwlock, NULL);
     assert(errorcode == 0);
 
     // Assign the data member

Modified: llvm/trunk/lib/System/Win32/ThreadLocal.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/System/Win32/ThreadLocal.inc?rev=116909&r1=116908&r2=116909&view=diff
==============================================================================
--- llvm/trunk/lib/System/Win32/ThreadLocal.inc (original)
+++ llvm/trunk/lib/System/Win32/ThreadLocal.inc Tue Oct 19 23:05:29 2010
@@ -17,6 +17,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "Win32.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/System/ThreadLocal.h"
 
 namespace llvm {
@@ -42,9 +43,8 @@
 
 void ThreadLocalImpl::setInstance(const void* d){
   DWORD* tls = static_cast<DWORD*>(data);
-  int errorcode = TlsSetValue(*tls, const_cast<void*>(d));
+  int ATTRIBUTE_UNUSED errorcode = TlsSetValue(*tls, const_cast<void*>(d));
   assert(errorcode != 0);
-  (void)errorcode;
 }
 
 void ThreadLocalImpl::removeInstance() {





More information about the llvm-commits mailing list