From f10c519249f8565259c8dc6ff315d5090bdf9449 Mon Sep 17 00:00:00 2001 From: NAKAMURA Takumi Date: Wed, 20 Oct 2010 04:05:29 +0000 Subject: [PATCH] Add ATTRIBUTE_UNUSED for -Asserts. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116909 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/System/RWMutex.cpp | 4 ++-- lib/System/Win32/ThreadLocal.inc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/System/RWMutex.cpp b/lib/System/RWMutex.cpp index deb04709d82..be41ee6847d 100644 --- a/lib/System/RWMutex.cpp +++ b/lib/System/RWMutex.cpp @@ -12,6 +12,7 @@ //===----------------------------------------------------------------------===// #include "llvm/Config/config.h" +#include "llvm/Support/Compiler.h" #include "llvm/System/RWMutex.h" #include @@ -72,8 +73,7 @@ RWMutexImpl::RWMutexImpl() #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 diff --git a/lib/System/Win32/ThreadLocal.inc b/lib/System/Win32/ThreadLocal.inc index e7e3cb7ce11..b13c119c4e6 100644 --- a/lib/System/Win32/ThreadLocal.inc +++ b/lib/System/Win32/ThreadLocal.inc @@ -17,6 +17,7 @@ //===----------------------------------------------------------------------===// #include "Win32.h" +#include "llvm/Support/Compiler.h" #include "llvm/System/ThreadLocal.h" namespace llvm { @@ -42,9 +43,8 @@ const void* ThreadLocalImpl::getInstance() { void ThreadLocalImpl::setInstance(const void* d){ DWORD* tls = static_cast(data); - int errorcode = TlsSetValue(*tls, const_cast(d)); + int ATTRIBUTE_UNUSED errorcode = TlsSetValue(*tls, const_cast(d)); assert(errorcode != 0); - (void)errorcode; } void ThreadLocalImpl::removeInstance() { -- 2.34.1