Stub out and start using a Decl::Destroy() method.

llvm-svn: 49532
This commit is contained in:
Sam Bishop 2008-04-11 15:01:25 +00:00
parent 4c088b766d
commit 703ae9624b
3 changed files with 8 additions and 1 deletions

View File

@ -179,6 +179,9 @@ public:
/// Create - Deserialize a Decl from Bitcode.
static Decl* Create(llvm::Deserializer& D, ASTContext& C);
/// Destroy - Call destructors and release memory.
void Destroy(ASTContext& C) const;
protected:
/// EmitImpl - Provides the subclass-specific serialization logic for
/// serializing out a decl.

View File

@ -329,6 +329,10 @@ const Attr *Decl::getAttrs() const {
return (*DeclAttrs)[this];
}
void Decl::Destroy(ASTContext& C) const {
C.getAllocator().Deallocate((void *)this);
}
//===----------------------------------------------------------------------===//
// DeclContext Implementation
//===----------------------------------------------------------------------===//

View File

@ -32,7 +32,7 @@ enum { BasicMetadataBlock = 1,
TranslationUnit::~TranslationUnit() {
for (iterator I=begin(), E=end(); I!=E; ++I)
delete *I;
(*I)->Destroy(*Context);
}
bool clang::EmitASTBitcodeFile(const TranslationUnit& TU,