summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-03-04 06:34:08 +0000
committerChris Lattner <sabre@nondot.org>2009-03-04 06:34:08 +0000
commit9631e1871e5755d69418126a24a8b601b562bf56 (patch)
treece3c251993ab9ce73997bf2fbcdfbedac2bb025b /clang/lib/AST
parent7d41c616f15effe38b5f8c58f149831a6250c109 (diff)
downloadbcm5719-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.cpp11
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();
}
OpenPOWER on IntegriCloud