diff options
author | Duncan Sands <baldrick@free.fr> | 2009-09-06 10:53:22 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2009-09-06 10:53:22 +0000 |
commit | 740eb5323e449ae4b00a3f657bffaceadcbe2624 (patch) | |
tree | 5162422a9c3a3699644b9f34b51fb80fa07b18d5 /lib/System | |
parent | 12fd767ed819e3ea34670cc6f3e790bd0d88ee94 (diff) | |
download | external_llvm-740eb5323e449ae4b00a3f657bffaceadcbe2624.zip external_llvm-740eb5323e449ae4b00a3f657bffaceadcbe2624.tar.gz external_llvm-740eb5323e449ae4b00a3f657bffaceadcbe2624.tar.bz2 |
Tweak code into an equivalent form for which icc
doesn't warn about unreachable instructions. Patch
by Erick Tryzelaar (#111).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81110 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/System')
-rw-r--r-- | lib/System/Mutex.cpp | 9 | ||||
-rw-r--r-- | lib/System/RWMutex.cpp | 12 | ||||
-rw-r--r-- | lib/System/Unix/Process.inc | 9 |
3 files changed, 13 insertions, 17 deletions
diff --git a/lib/System/Mutex.cpp b/lib/System/Mutex.cpp index a5e9920..8ccd6e5 100644 --- a/lib/System/Mutex.cpp +++ b/lib/System/Mutex.cpp @@ -115,8 +115,7 @@ MutexImpl::acquire() int errorcode = pthread_mutex_lock(mutex); return errorcode == 0; - } - return false; + } else return false; } bool @@ -129,8 +128,7 @@ MutexImpl::release() int errorcode = pthread_mutex_unlock(mutex); return errorcode == 0; - } - return false; + } else return false; } bool @@ -143,8 +141,7 @@ MutexImpl::tryacquire() int errorcode = pthread_mutex_trylock(mutex); return errorcode == 0; - } - return false; + } else return false; } } diff --git a/lib/System/RWMutex.cpp b/lib/System/RWMutex.cpp index 15d98cb..5faf220 100644 --- a/lib/System/RWMutex.cpp +++ b/lib/System/RWMutex.cpp @@ -117,8 +117,7 @@ RWMutexImpl::reader_acquire() int errorcode = pthread_rwlock_rdlock(rwlock); return errorcode == 0; - } - return false; + } else return false; } bool @@ -131,8 +130,7 @@ RWMutexImpl::reader_release() int errorcode = pthread_rwlock_unlock(rwlock); return errorcode == 0; - } - return false; + } else return false; } bool @@ -145,8 +143,7 @@ RWMutexImpl::writer_acquire() int errorcode = pthread_rwlock_wrlock(rwlock); return errorcode == 0; - } - return false; + } else return false; } bool @@ -159,8 +156,7 @@ RWMutexImpl::writer_release() int errorcode = pthread_rwlock_unlock(rwlock); return errorcode == 0; - } - return false; + } else return false; } } diff --git a/lib/System/Unix/Process.inc b/lib/System/Unix/Process.inc index c4ce35a..774783f 100644 --- a/lib/System/Unix/Process.inc +++ b/lib/System/Unix/Process.inc @@ -181,25 +181,28 @@ void Process::PreventCoreFiles() { bool Process::StandardInIsUserInput() { #if HAVE_ISATTY return isatty(0); -#endif +#else // If we don't have isatty, just return false. return false; +#endif } bool Process::StandardOutIsDisplayed() { #if HAVE_ISATTY return isatty(1); -#endif +#else // If we don't have isatty, just return false. return false; +#endif } bool Process::StandardErrIsDisplayed() { #if HAVE_ISATTY return isatty(2); -#endif +#else // If we don't have isatty, just return false. return false; +#endif } static unsigned getColumns(int FileID) { |