From 794a0714ad459bb971c038e544867d106ec43264 Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Sat, 19 Mar 2011 00:59:33 +0000 Subject: 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. llvm-svn: 127928 --- llvm/lib/Support/CrashRecoveryContext.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'llvm/lib/Support/CrashRecoveryContext.cpp') diff --git a/llvm/lib/Support/CrashRecoveryContext.cpp b/llvm/lib/Support/CrashRecoveryContext.cpp index e190051e6db..d4e21a3a826 100644 --- a/llvm/lib/Support/CrashRecoveryContext.cpp +++ b/llvm/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; -- cgit v1.2.3