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();
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,