forked from OSchip/llvm-project
Use ASTContext's allocator to deallocate Stmt objects instead of using 'delete'. This fixes <rdar://problem/6561143>.
llvm-svn: 63905
This commit is contained in:
parent
9f3f72f144
commit
fe7a9601e9
|
@ -15,6 +15,7 @@
|
||||||
#include "clang/AST/ExprCXX.h"
|
#include "clang/AST/ExprCXX.h"
|
||||||
#include "clang/AST/ExprObjC.h"
|
#include "clang/AST/ExprObjC.h"
|
||||||
#include "clang/AST/Type.h"
|
#include "clang/AST/Type.h"
|
||||||
|
#include "clang/AST/ASTContext.h"
|
||||||
using namespace clang;
|
using namespace clang;
|
||||||
|
|
||||||
static struct StmtClassNameTable {
|
static struct StmtClassNameTable {
|
||||||
|
@ -52,13 +53,14 @@ void Stmt::Destroy(ASTContext& C) {
|
||||||
DestroyChildren(C);
|
DestroyChildren(C);
|
||||||
// FIXME: Eventually all Stmts should be allocated with the allocator
|
// FIXME: Eventually all Stmts should be allocated with the allocator
|
||||||
// in ASTContext, just like with Decls.
|
// in ASTContext, just like with Decls.
|
||||||
// this->~Stmt();
|
this->~Stmt();
|
||||||
delete this;
|
C.Deallocate((void *)this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DeclStmt::Destroy(ASTContext& C) {
|
void DeclStmt::Destroy(ASTContext& C) {
|
||||||
DG.Destroy(C);
|
DG.Destroy(C);
|
||||||
delete this;
|
this->~DeclStmt();
|
||||||
|
C.Deallocate((void *)this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Stmt::PrintStats() {
|
void Stmt::PrintStats() {
|
||||||
|
|
Loading…
Reference in New Issue