add actions for deleting expr/stmt nodes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41635 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Sema/Sema.cpp b/Sema/Sema.cpp
index f783302..1a01270 100644
--- a/Sema/Sema.cpp
+++ b/Sema/Sema.cpp
@@ -38,6 +38,13 @@
   KnownFunctionIDs[ id_vprintf ] = &IT.get("vprintf");
 }
 
+void Sema::DeleteExpr(ExprTy *E) {
+  delete static_cast<Expr*>(E);
+}
+void Sema::DeleteStmt(StmtTy *S) {
+  delete static_cast<Stmt*>(S);
+}
+
 //===----------------------------------------------------------------------===//
 // Helper functions.
 //===----------------------------------------------------------------------===//
diff --git a/Sema/Sema.h b/Sema/Sema.h
index fbf4f53..046305e 100644
--- a/Sema/Sema.h
+++ b/Sema/Sema.h
@@ -120,6 +120,9 @@
             const std::string &Msg1, const std::string &Msg2, 
             SourceRange R1, SourceRange R2);
 
+  virtual void DeleteExpr(ExprTy *E);
+  virtual void DeleteStmt(StmtTy *S);
+
   //===--------------------------------------------------------------------===//
   // Type Analysis / Processing: SemaType.cpp.
   //