diff options
author | Steve Naroff <snaroff@apple.com> | 2009-01-27 23:20:32 +0000 |
---|---|---|
committer | Steve Naroff <snaroff@apple.com> | 2009-01-27 23:20:32 +0000 |
commit | 99c0cdf899af1320b76020c02349ba5864996c0c (patch) | |
tree | a76790ed40f5c0eaf61a19758e36808af6bae499 /clang/lib/AST/DeclGroup.cpp | |
parent | 4e04ef3c55b88d5fb581419b8f394da219e3375c (diff) | |
download | bcm5719-llvm-99c0cdf899af1320b76020c02349ba5864996c0c.tar.gz bcm5719-llvm-99c0cdf899af1320b76020c02349ba5864996c0c.zip |
Finish making AST BumpPtrAllocation runtime configurable (based on -disable-free).
snaroff% time ../../Release-Asserts/bin/clang INPUTS/Cocoa_h.m
0.179u 0.051s 0:00.23 95.6% 0+0k 0+0io 0pf+0w
snaroff% time ../../Release-Asserts/bin/clang INPUTS/Cocoa_h.m -disable-free
0.169u 0.052s 0:00.22 95.4% 0+0k 0+0io 0pf+0w
llvm-svn: 63153
Diffstat (limited to 'clang/lib/AST/DeclGroup.cpp')
-rw-r--r-- | clang/lib/AST/DeclGroup.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/AST/DeclGroup.cpp b/clang/lib/AST/DeclGroup.cpp index c7af7cd89ea..e7f84e1f46c 100644 --- a/clang/lib/AST/DeclGroup.cpp +++ b/clang/lib/AST/DeclGroup.cpp @@ -24,7 +24,7 @@ DeclGroup* DeclGroup::Create(ASTContext& C, unsigned numdecls, Decl** decls) { assert (numdecls > 0); unsigned size = sizeof(DeclGroup) + sizeof(Decl*) * numdecls; unsigned alignment = llvm::AlignOf<DeclGroup>::Alignment; - void* mem = C.getAllocator().Allocate(size, alignment); + void* mem = C.Allocate(size, alignment); new (mem) DeclGroup(numdecls, decls); return static_cast<DeclGroup*>(mem); } @@ -40,7 +40,7 @@ DeclGroup* DeclGroup::Create(llvm::Deserializer& D, ASTContext& C) { unsigned NumDecls = (unsigned) D.ReadInt(); unsigned size = sizeof(DeclGroup) + sizeof(Decl*) * NumDecls; unsigned alignment = llvm::AlignOf<DeclGroup>::Alignment; - DeclGroup* DG = (DeclGroup*) C.getAllocator().Allocate(size, alignment); + DeclGroup* DG = (DeclGroup*) C.Allocate(size, alignment); new (DG) DeclGroup(); DG->NumDecls = NumDecls; D.BatchReadOwnedPtrs(NumDecls, &(*DG)[0], C); |