aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/ASTContext.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-01-20 21:02:13 +0000
committerDouglas Gregor <dgregor@apple.com>2009-01-20 21:02:13 +0000
commitb17e3b04fa50ca542ccbbf69847f62e5f043df03 (patch)
tree9bb1364fa236c9a123daa7c200b5a1f6490b79b7 /lib/AST/ASTContext.cpp
parentd9fca6e3950346ea503f92f27ed0f9d8edde9feb (diff)
Use the ASTContext's allocator for FunctionTypeNoProto and TypeOfExpr
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62611 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ASTContext.cpp')
-rw-r--r--lib/AST/ASTContext.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp
index d1a8b8208b..d20387dd95 100644
--- a/lib/AST/ASTContext.cpp
+++ b/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);
}