[PATCH] Clang side changes for removal of support for runtime multi-threading.
Zachary Turner
zturner at google.com
Tue Jun 10 16:10:07 PDT 2014
Closed by commit rL210601 (authored by @zturner).
http://reviews.llvm.org/D4077
Files:
cfe/trunk/tools/libclang/CIndex.cpp
Index: cfe/trunk/tools/libclang/CIndex.cpp
===================================================================
--- cfe/trunk/tools/libclang/CIndex.cpp
+++ cfe/trunk/tools/libclang/CIndex.cpp
@@ -2556,8 +2556,8 @@
// Misc. API hooks.
//===----------------------------------------------------------------------===//
-static llvm::sys::Mutex EnableMultithreadingMutex;
-static bool EnabledMultithreading;
+static llvm::sys::Mutex LoggingMutex;
+static std::once_flag InstalledErrorHandlerFlag;
static void fatal_error_handler(void *user_data, const std::string& reason,
bool gen_crash_diag) {
@@ -2575,15 +2575,8 @@
if (!getenv("LIBCLANG_DISABLE_CRASH_RECOVERY"))
llvm::CrashRecoveryContext::Enable();
- // Enable support for multithreading in LLVM.
- {
- llvm::sys::ScopedLock L(EnableMultithreadingMutex);
- if (!EnabledMultithreading) {
- llvm::install_fatal_error_handler(fatal_error_handler, nullptr);
- llvm::llvm_start_multithreaded();
- EnabledMultithreading = true;
- }
- }
+ std::call_once(InstalledErrorHandlerFlag,
+ []() {llvm::install_fatal_error_handler(fatal_error_handler, nullptr);});
CIndexer *CIdxr = new CIndexer();
if (excludeDeclarationsFromPCH)
@@ -6959,7 +6952,7 @@
cxindex::Logger::~Logger() {
LogOS.flush();
- llvm::sys::ScopedLock L(EnableMultithreadingMutex);
+ llvm::sys::ScopedLock L(LoggingMutex);
static llvm::TimeRecord sBeginTR = llvm::TimeRecord::getCurrentTime();
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D4077.10307.patch
Type: text/x-patch
Size: 1519 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140610/da0fb695/attachment.bin>
More information about the cfe-commits
mailing list