From: Ted Kremenek Date: Sat, 19 Mar 2011 00:59:33 +0000 (+0000) Subject: Tweak CrashRecoveryContext::GetCurrent() to return quickly if 'gCrsahRecoveryEnabled... X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=fb200e30a48c3e682742174453d9550d1dc589d5;p=oota-llvm.git 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127928 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Support/CrashRecoveryContext.cpp b/lib/Support/CrashRecoveryContext.cpp index e190051e6db..d4e21a3a826 100644 --- a/lib/Support/CrashRecoveryContext.cpp +++ b/lib/Support/CrashRecoveryContext.cpp @@ -74,6 +74,9 @@ CrashRecoveryContext::~CrashRecoveryContext() { } CrashRecoveryContext *CrashRecoveryContext::GetCurrent() { + if (!gCrashRecoveryEnabled) + return 0; + const CrashRecoveryContextImpl *CRCI = CurrentContext.get(); if (!CRCI) return 0;