r210604 - Revert "Clang changes to support LLVM removal of runtime multithreading"
David Blaikie
dblaikie at gmail.com
Tue Jun 10 16:36:20 PDT 2014
On Tue, Jun 10, 2014 at 4:17 PM, Zachary Turner <zturner at google.com> wrote:
> Author: zturner
> Date: Tue Jun 10 18:17:11 2014
> New Revision: 210604
>
> URL: http://llvm.org/viewvc/llvm-project?rev=210604&view=rev
> Log:
> Revert "Clang changes to support LLVM removal of runtime multithreading"
>
> This reverts r210601.
As a general rule/suggestion/advice-for-next-time: it's usually
helpful to mention in the commit message why you're reverting
something.
>
> Modified:
> cfe/trunk/tools/libclang/CIndex.cpp
>
> Modified: cfe/trunk/tools/libclang/CIndex.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CIndex.cpp?rev=210604&r1=210603&r2=210604&view=diff
> ==============================================================================
> --- cfe/trunk/tools/libclang/CIndex.cpp (original)
> +++ cfe/trunk/tools/libclang/CIndex.cpp Tue Jun 10 18:17:11 2014
> @@ -2556,8 +2556,8 @@ buildPieces(unsigned NameFlags, bool IsM
> // Misc. API hooks.
> //===----------------------------------------------------------------------===//
>
> -static llvm::sys::Mutex LoggingMutex;
> -static std::once_flag InstalledErrorHandlerFlag;
> +static llvm::sys::Mutex EnableMultithreadingMutex;
> +static bool EnabledMultithreading;
>
> static void fatal_error_handler(void *user_data, const std::string& reason,
> bool gen_crash_diag) {
> @@ -2575,8 +2575,15 @@ CXIndex clang_createIndex(int excludeDec
> if (!getenv("LIBCLANG_DISABLE_CRASH_RECOVERY"))
> llvm::CrashRecoveryContext::Enable();
>
> - std::call_once(InstalledErrorHandlerFlag,
> - []() {llvm::install_fatal_error_handler(fatal_error_handler, nullptr);});
> + // 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;
> + }
> + }
>
> CIndexer *CIdxr = new CIndexer();
> if (excludeDeclarationsFromPCH)
> @@ -6952,7 +6959,7 @@ Logger &cxindex::Logger::operator<<(cons
> cxindex::Logger::~Logger() {
> LogOS.flush();
>
> - llvm::sys::ScopedLock L(LoggingMutex);
> + llvm::sys::ScopedLock L(EnableMultithreadingMutex);
>
> static llvm::TimeRecord sBeginTR = llvm::TimeRecord::getCurrentTime();
>
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
More information about the cfe-commits
mailing list