Remove many references to ASTContext::getAllocator(), replacing them with calls to the recently added placement new (which uses ASTContext's allocator for memory). Also added ASTContext::Deallocate().
This will simplify runtime replacement of ASTContext's allocator. Keeping the allocator private (and removing getAllocator() entirely) is also goodness.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63135 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/Type.cpp b/lib/AST/Type.cpp
index 7d9be2d..65fd3b4 100644
--- a/lib/AST/Type.cpp
+++ b/lib/AST/Type.cpp
@@ -32,19 +32,19 @@
void Type::Destroy(ASTContext& C) {
this->~Type();
- C.getAllocator().Deallocate(this);
+ C.Deallocate(this);
}
void VariableArrayType::Destroy(ASTContext& C) {
SizeExpr->Destroy(C);
this->~VariableArrayType();
- C.getAllocator().Deallocate(this);
+ C.Deallocate(this);
}
void DependentSizedArrayType::Destroy(ASTContext& C) {
SizeExpr->Destroy(C);
this->~DependentSizedArrayType();
- C.getAllocator().Deallocate(this);
+ C.Deallocate(this);
}
/// getArrayElementTypeNoTypeQual - If this is an array type, return the