summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2011-03-21 18:40:07 +0000
committerTed Kremenek <kremenek@apple.com>2011-03-21 18:40:07 +0000
commit84de4a17816bcfc92c40a9c97803e10b20f5b2e3 (patch)
treed2856fa1bf7474e6abbcd7ea6d756daff05f2363 /clang/lib/Basic
parentab1a242ead80c39f32fafc297263a22365aa203d (diff)
downloadbcm5719-llvm-84de4a17816bcfc92c40a9c97803e10b20f5b2e3.tar.gz
bcm5719-llvm-84de4a17816bcfc92c40a9c97803e10b20f5b2e3.zip
Use CrashRecoveryContextCleanup objects to reclaim resources from CompilerInstance objects.
llvm-svn: 128009
Diffstat (limited to 'clang/lib/Basic')
-rw-r--r--clang/lib/Basic/Diagnostic.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/clang/lib/Basic/Diagnostic.cpp b/clang/lib/Basic/Diagnostic.cpp
index 31e33315cce..f654ede49d0 100644
--- a/clang/lib/Basic/Diagnostic.cpp
+++ b/clang/lib/Basic/Diagnostic.cpp
@@ -16,6 +16,8 @@
#include "clang/Basic/PartialDiagnostic.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/Support/raw_ostream.h"
+#include "llvm/Support/CrashRecoveryContext.h"
+
using namespace clang;
static void DummyArgToStringFn(Diagnostic::ArgumentKind AK, intptr_t QT,
@@ -683,5 +685,9 @@ PartialDiagnostic::StorageAllocator::StorageAllocator() {
}
PartialDiagnostic::StorageAllocator::~StorageAllocator() {
- assert(NumFreeListEntries == NumCached && "A partial is on the lamb");
+ // Don't assert if we are in a CrashRecovery context, as this
+ // invariant may be invalidated during a crash.
+ assert((NumFreeListEntries == NumCached ||
+ llvm::CrashRecoveryContext::isRecoveringFromCrash())
+ && "A partial is on the lamb");
}
OpenPOWER on IntegriCloud