summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/Sema/TypeLocBuilder.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/lib/Sema/TypeLocBuilder.h b/clang/lib/Sema/TypeLocBuilder.h
index 1e0a7c45467..7b241871b67 100644
--- a/clang/lib/Sema/TypeLocBuilder.h
+++ b/clang/lib/Sema/TypeLocBuilder.h
@@ -18,6 +18,7 @@
#include "clang/AST/TypeLoc.h"
#include "llvm/ADT/SmallVector.h"
#include "clang/AST/ASTContext.h"
+#include "llvm/Support/CrashRecoveryContext.h"
namespace clang {
@@ -42,9 +43,13 @@ class TypeLocBuilder {
/// The inline buffer.
char InlineBuffer[InlineCapacity];
+ llvm::CrashRecoveryContextCleanupRegistrar cleanupBuffer;
+
public:
TypeLocBuilder()
- : Buffer(InlineBuffer), Capacity(InlineCapacity), Index(InlineCapacity)
+ : Buffer(InlineBuffer), Capacity(InlineCapacity), Index(InlineCapacity),
+ cleanupBuffer(llvm::CrashRecoveryContextCleanup::create<TypeLocBuilder>(
+ this, llvm::CrashRecoveryContextCleanup::DestructorCleanup))
{}
~TypeLocBuilder() {
OpenPOWER on IntegriCloud