summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-05-20 04:10:52 +0000
committerTed Kremenek <kremenek@apple.com>2008-05-20 04:10:52 +0000
commit40e489dfd8220d4f0b3ac1182d84350c00250920 (patch)
treee752e9c53ec6abaf738d52b664228e46458fb7f6
parentfa8a09e0bc49f3ba909816f48af1f810a9d03089 (diff)
downloadbcm5719-llvm-40e489dfd8220d4f0b3ac1182d84350c00250920.tar.gz
bcm5719-llvm-40e489dfd8220d4f0b3ac1182d84350c00250920.zip
Delete AST nodes, not just Decls.
llvm-svn: 51298
-rw-r--r--clang/include/clang/AST/Expr.h6
-rw-r--r--clang/lib/AST/Stmt.cpp5
2 files changed, 6 insertions, 5 deletions
diff --git a/clang/include/clang/AST/Expr.h b/clang/include/clang/AST/Expr.h
index 3699ba1df70..6f2ff83f5fd 100644
--- a/clang/include/clang/AST/Expr.h
+++ b/clang/include/clang/AST/Expr.h
@@ -1116,8 +1116,8 @@ public:
QualType Type, SourceLocation BLoc,
SourceLocation RP) :
Expr(ShuffleVectorExprClass, Type), BuiltinLoc(BLoc),
- RParenLoc(RP), NumExprs(nexpr)
- {
+ RParenLoc(RP), NumExprs(nexpr) {
+
SubExprs = new Expr*[nexpr];
for (unsigned i = 0; i < nexpr; i++)
SubExprs[i] = args[i];
@@ -1132,8 +1132,6 @@ public:
static bool classof(const ShuffleVectorExpr *) { return true; }
~ShuffleVectorExpr() {
- for (unsigned i = 0; i < NumExprs; i++)
- delete SubExprs[i];
delete [] SubExprs;
}
diff --git a/clang/lib/AST/Stmt.cpp b/clang/lib/AST/Stmt.cpp
index 993dda71c98..6ed99661355 100644
--- a/clang/lib/AST/Stmt.cpp
+++ b/clang/lib/AST/Stmt.cpp
@@ -49,7 +49,10 @@ void Stmt::DestroyChildren(ASTContext& C) {
void Stmt::Destroy(ASTContext& C) {
DestroyChildren(C);
- this->~Stmt();
+ // FIXME: Eventually all Stmts should be allocated with the allocator
+ // in ASTContext, just like with Decls.
+ // this->~Stmt();
+ delete this;
}
void Stmt::PrintStats() {
OpenPOWER on IntegriCloud