forked from OSchip/llvm-project
Stub out and start using a Decl::Destroy() method.
llvm-svn: 49532
This commit is contained in:
parent
4c088b766d
commit
703ae9624b
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue