Skip to content

Commit

Permalink
Tweak CrashRecoveryContext::GetCurrent() to return quickly if 'gCrsah…
Browse files Browse the repository at this point in the history
…RecoveryEnabled' 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
  • Loading branch information
tkremenek committed Mar 19, 2011
1 parent f6325b9 commit fb200e3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/Support/CrashRecoveryContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ CrashRecoveryContext::~CrashRecoveryContext() {
}

CrashRecoveryContext *CrashRecoveryContext::GetCurrent() {
if (!gCrashRecoveryEnabled)
return 0;

const CrashRecoveryContextImpl *CRCI = CurrentContext.get();
if (!CRCI)
return 0;
Expand Down

0 comments on commit fb200e3

Please sign in to comment.