diff options
| author | Douglas Gregor <dgregor@apple.com> | 2009-01-20 21:02:13 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2009-01-20 21:02:13 +0000 |
| commit | 82c1fe1cfcfac87c240738c2abea135f4ef3e6f2 (patch) | |
| tree | 184c6f1e8d3c1e2f95be8fd1a9e5ba2fb4004aeb | |
| parent | bd7743d772332832c91c167fb1e5342ecf8c8cb3 (diff) | |
| download | bcm5719-llvm-82c1fe1cfcfac87c240738c2abea135f4ef3e6f2.tar.gz bcm5719-llvm-82c1fe1cfcfac87c240738c2abea135f4ef3e6f2.zip | |
Use the ASTContext's allocator for FunctionTypeNoProto and TypeOfExpr
llvm-svn: 62611
| -rw-r--r-- | clang/lib/AST/ASTContext.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index d1a8b8208b4..d20387dd95e 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -1003,7 +1003,8 @@ QualType ASTContext::getFunctionTypeNoProto(QualType ResultTy) { assert(NewIP == 0 && "Shouldn't be in the map!"); NewIP = NewIP; } - FunctionTypeNoProto *New = new FunctionTypeNoProto(ResultTy, Canonical); + void *Mem = Allocator.Allocate(sizeof(FunctionTypeNoProto), 8); + FunctionTypeNoProto *New = new (Mem) FunctionTypeNoProto(ResultTy, Canonical); Types.push_back(New); FunctionTypeNoProtos.InsertNode(New, InsertPos); return QualType(New, 0); @@ -1216,7 +1217,8 @@ QualType ASTContext::getObjCQualifiedIdType(ObjCProtocolDecl **Protocols, /// on canonical type's (which are always unique). QualType ASTContext::getTypeOfExpr(Expr *tofExpr) { QualType Canonical = getCanonicalType(tofExpr->getType()); - TypeOfExpr *toe = new TypeOfExpr(tofExpr, Canonical); + void *Mem = Allocator.Allocate(sizeof(TypeOfExpr), 8); + TypeOfExpr *toe = new (Mem) TypeOfExpr(tofExpr, Canonical); Types.push_back(toe); return QualType(toe, 0); } |

