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 | 9631e1871e5755d69418126a24a8b601b562bf56 (patch) | |
| tree | ce3c251993ab9ce73997bf2fbcdfbedac2bb025b /clang/lib/AST | |
| parent | 7d41c616f15effe38b5f8c58f149831a6250c109 (diff) | |
| download | bcm5719-llvm-9631e1871e5755d69418126a24a8b601b562bf56.tar.gz bcm5719-llvm-9631e1871e5755d69418126a24a8b601b562bf56.zip | |
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).
llvm-svn: 66023
Diffstat (limited to 'clang/lib/AST')
| -rw-r--r-- | clang/lib/AST/Decl.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp index 1ebfbf79dac..eaf69f0197c 100644 --- a/clang/lib/AST/Decl.cpp +++ b/clang/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(); } |

