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
MutexImpl(rec), acquired(0), recursive(rec) { }
bool acquire() {
MutexImpl(rec), acquired(0), recursive(rec) { }
bool acquire() {
- if (!mt_only || llvm_is_multithreaded())
+ if (!mt_only || llvm_is_multithreaded()) {
return MutexImpl::acquire();
return MutexImpl::acquire();
-
- // Single-threaded debugging code. This would be racy in multithreaded
- // mode, but provides not sanity checks in single threaded mode.
- assert((recursive || acquired == 0) && "Lock already acquired!!");
- ++acquired;
- return true;
+ } else {
+ // Single-threaded debugging code. This would be racy in
+ // multithreaded mode, but provides not sanity checks in single
+ // threaded mode.
+ assert((recursive || acquired == 0) && "Lock already acquired!!");
+ ++acquired;
+ return true;
+ }
- if (!mt_only || llvm_is_multithreaded())
+ if (!mt_only || llvm_is_multithreaded()) {
return MutexImpl::release();
return MutexImpl::release();
-
- // Single-threaded debugging code. This would be racy in multithreaded
- // mode, but provides not sanity checks in single threaded mode.
- assert(((recursive && acquired) || (acquired == 1)) &&
- "Lock not acquired before release!");
- --acquired;
- return true;
+ } else {
+ // Single-threaded debugging code. This would be racy in
+ // multithreaded mode, but provides not sanity checks in single
+ // threaded mode.
+ assert(((recursive && acquired) || (acquired == 1)) &&
+ "Lock not acquired before release!");
+ --acquired;
+ return true;
+ }
}
bool tryacquire() {
if (!mt_only || llvm_is_multithreaded())
return MutexImpl::tryacquire();
}
bool tryacquire() {
if (!mt_only || llvm_is_multithreaded())
return MutexImpl::tryacquire();
int errorcode = pthread_mutex_lock(mutex);
return errorcode == 0;
int errorcode = pthread_mutex_lock(mutex);
return errorcode == 0;
int errorcode = pthread_mutex_unlock(mutex);
return errorcode == 0;
int errorcode = pthread_mutex_unlock(mutex);
return errorcode == 0;
int errorcode = pthread_mutex_trylock(mutex);
return errorcode == 0;
int errorcode = pthread_mutex_trylock(mutex);
return errorcode == 0;
int errorcode = pthread_rwlock_rdlock(rwlock);
return errorcode == 0;
int errorcode = pthread_rwlock_rdlock(rwlock);
return errorcode == 0;
int errorcode = pthread_rwlock_unlock(rwlock);
return errorcode == 0;
int errorcode = pthread_rwlock_unlock(rwlock);
return errorcode == 0;
int errorcode = pthread_rwlock_wrlock(rwlock);
return errorcode == 0;
int errorcode = pthread_rwlock_wrlock(rwlock);
return errorcode == 0;
int errorcode = pthread_rwlock_unlock(rwlock);
return errorcode == 0;
int errorcode = pthread_rwlock_unlock(rwlock);
return errorcode == 0;
bool Process::StandardInIsUserInput() {
#if HAVE_ISATTY
return isatty(0);
bool Process::StandardInIsUserInput() {
#if HAVE_ISATTY
return isatty(0);
// If we don't have isatty, just return false.
return false;
// If we don't have isatty, just return false.
return false;
}
bool Process::StandardOutIsDisplayed() {
#if HAVE_ISATTY
return isatty(1);
}
bool Process::StandardOutIsDisplayed() {
#if HAVE_ISATTY
return isatty(1);
// If we don't have isatty, just return false.
return false;
// If we don't have isatty, just return false.
return false;
}
bool Process::StandardErrIsDisplayed() {
#if HAVE_ISATTY
return isatty(2);
}
bool Process::StandardErrIsDisplayed() {
#if HAVE_ISATTY
return isatty(2);
// If we don't have isatty, just return false.
return false;
// If we don't have isatty, just return false.
return false;
}
static unsigned getColumns(int FileID) {
}
static unsigned getColumns(int FileID) {