[llvm-commits] [llvm] r127928 - /llvm/trunk/lib/Support/CrashRecoveryContext.cpp

Ted Kremenek kremenek at apple.com
Fri Mar 18 17:59:33 PDT 2011


Author: kremenek
Date: Fri Mar 18 19:59:33 2011
New Revision: 127928

URL: http://llvm.org/viewvc/llvm-project?rev=127928&view=rev
Log:
Tweak CrashRecoveryContext::GetCurrent() to return quickly if 'gCrsahRecoveryEnabled' is false.  This avoids us needing to go to thread local storage for
the performance sensitive case where we are compiling code.

Modified:
    llvm/trunk/lib/Support/CrashRecoveryContext.cpp

Modified: llvm/trunk/lib/Support/CrashRecoveryContext.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/CrashRecoveryContext.cpp?rev=127928&r1=127927&r2=127928&view=diff
==============================================================================
--- llvm/trunk/lib/Support/CrashRecoveryContext.cpp (original)
+++ llvm/trunk/lib/Support/CrashRecoveryContext.cpp Fri Mar 18 19:59:33 2011
@@ -74,6 +74,9 @@
 }
 
 CrashRecoveryContext *CrashRecoveryContext::GetCurrent() {
+  if (!gCrashRecoveryEnabled)
+    return 0;
+
   const CrashRecoveryContextImpl *CRCI = CurrentContext.get();
   if (!CRCI)
     return 0;





More information about the llvm-commits mailing list