diff options
author | Chris Lattner <sabre@nondot.org> | 2009-03-04 06:34:08 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-03-04 06:34:08 +0000 |
commit | 0b2b6e1cb1573bb295c0a65813dc4df8d57f305b (patch) | |
tree | 589229ea4c46c0f00d28e87cec88880fd2c107be /lib/AST/Decl.cpp | |
parent | 63d1d60e853e6af6b48b1a8cdb93835a7e86f32e (diff) |
Switch attributes to be allocated from the declcontext bump pointer just like
decls. This reduces the number of calls to malloc on cocoa.h with pth and
-disable-free from 15958 to 12444 times (down ~3500).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66023 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Decl.cpp')
-rw-r--r-- | lib/AST/Decl.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp index 1ebfbf79da..eaf69f0197 100644 --- a/lib/AST/Decl.cpp +++ b/lib/AST/Decl.cpp @@ -22,10 +22,21 @@ using namespace clang; +void Attr::Destroy(ASTContext &C) { + if (Next) { + Next->Destroy(C); + Next = 0; + } + this->~Attr(); + C.Deallocate((void*)this); +} + + //===----------------------------------------------------------------------===// // Decl Allocation/Deallocation Method Implementations //===----------------------------------------------------------------------===// + TranslationUnitDecl *TranslationUnitDecl::Create(ASTContext &C) { return new (C) TranslationUnitDecl(); } |