diff options
-rw-r--r-- | include/clang/AST/TranslationUnit.h | 5 | ||||
-rw-r--r-- | lib/AST/TranslationUnit.cpp | 9 |
2 files changed, 2 insertions, 12 deletions
diff --git a/include/clang/AST/TranslationUnit.h b/include/clang/AST/TranslationUnit.h index 2b22cf98e4..5ebcfa649d 100644 --- a/include/clang/AST/TranslationUnit.h +++ b/include/clang/AST/TranslationUnit.h @@ -32,14 +32,13 @@ class FileEntry; class TranslationUnit { ASTContext* Context; - bool OwnsMetaData; // The default ctor is only invoked during deserialization. - explicit TranslationUnit() : Context(NULL), OwnsMetaData(true){} + explicit TranslationUnit() : Context(NULL) {} public: explicit TranslationUnit(ASTContext& Ctx) - : Context(&Ctx), OwnsMetaData(false) {} + : Context(&Ctx){} ~TranslationUnit(); diff --git a/lib/AST/TranslationUnit.cpp b/lib/AST/TranslationUnit.cpp index df135edf63..57f9f4ebc8 100644 --- a/lib/AST/TranslationUnit.cpp +++ b/lib/AST/TranslationUnit.cpp @@ -28,15 +28,6 @@ using namespace clang; TranslationUnit::~TranslationUnit() { - if (OwnsMetaData && Context) { - // The ASTContext object has the sole references to the IdentifierTable - // Selectors, and the Target information. Go and delete them, since - // the TranslationUnit effectively owns them. - delete &Context->Idents; - delete &Context->Selectors; - delete &Context->Target; - delete Context; - } } bool clang::EmitASTBitcodeBuffer(const ASTContext &Ctx, |