aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/Decl.cpp
diff options
context:
space:
mode:
authorSteve Naroff <snaroff@apple.com>2009-01-27 23:20:32 +0000
committerSteve Naroff <snaroff@apple.com>2009-01-27 23:20:32 +0000
commitc0ac4923f08b25ae973a8ee7942cf3eb89da57b7 (patch)
treeb6b9ce974fc742f015b06cab38436c181c6ebd7c /lib/AST/Decl.cpp
parentdb64728e69a45b89870ede13944a934d3c2ed12a (diff)
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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63153 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Decl.cpp')
-rw-r--r--lib/AST/Decl.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp
index c8b7fc2dcf..25317dbeb1 100644
--- a/lib/AST/Decl.cpp
+++ b/lib/AST/Decl.cpp
@@ -118,8 +118,7 @@ TypedefDecl *TypedefDecl::Create(ASTContext &C, DeclContext *DC,
EnumDecl *EnumDecl::Create(ASTContext &C, DeclContext *DC, SourceLocation L,
IdentifierInfo *Id,
EnumDecl *PrevDecl) {
- void *Mem = C.getAllocator().Allocate<EnumDecl>();
- EnumDecl *Enum = new (Mem) EnumDecl(DC, L, Id);
+ EnumDecl *Enum = new (C) EnumDecl(DC, L, Id);
C.getTypeDeclType(Enum, PrevDecl);
return Enum;
}
@@ -229,7 +228,7 @@ void FunctionDecl::setParams(ASTContext& C, ParmVarDecl **NewParamInfo,
// Zero params -> null pointer.
if (NumParams) {
- void *Mem = C.getAllocator().Allocate<ParmVarDecl*>(NumParams);
+ void *Mem = C.Allocate(sizeof(ParmVarDecl*)*NumParams);
ParamInfo = new (Mem) ParmVarDecl*[NumParams];
memcpy(ParamInfo, NewParamInfo, sizeof(ParmVarDecl*)*NumParams);
}