Remove some code churn.

llvm-svn: 211068
This commit is contained in:
Zachary Turner 2014-06-16 22:40:29 +00:00
parent 0f2c641f86
commit d4f7dfe7f2
2 changed files with 3 additions and 4 deletions

View File

@ -18,11 +18,10 @@
#include "llvm/Support/Mutex.h"
namespace llvm {
/// llvm_get_global_lock() - returns the llvm global lock object.
/// llvm_get_global_lock - returns the llvm global lock object.
sys::Mutex &llvm_get_global_lock();
/// llvm_is_multithreaded() - returns true if LLVM is compiled with support
/// llvm_is_multithreaded - returns true if LLVM is compiled with support
/// for multiple threads, and false otherwise.
bool llvm_is_multithreaded();

View File

@ -24,7 +24,7 @@ void ManagedStaticBase::RegisterManagedStatic(void *(*Creator)(),
void (*Deleter)(void*)) const {
assert(Creator);
if (llvm_is_multithreaded()) {
llvm::MutexGuard Lock(llvm_get_global_lock());
llvm::MutexGuard Lock(llvm::llvm_get_global_lock());
if (!Ptr) {
void* tmp = Creator();