[cfe-commits] r41635 - in /cfe/trunk: Sema/Sema.cpp Sema/Sema.h include/clang/Parse/Action.h
Chris Lattner
sabre at nondot.org
Thu Aug 30 21:53:24 PDT 2007
Author: lattner
Date: Thu Aug 30 23:53:24 2007
New Revision: 41635
URL: http://llvm.org/viewvc/llvm-project?rev=41635&view=rev
Log:
add actions for deleting expr/stmt nodes.
Modified:
cfe/trunk/Sema/Sema.cpp
cfe/trunk/Sema/Sema.h
cfe/trunk/include/clang/Parse/Action.h
Modified: cfe/trunk/Sema/Sema.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Sema/Sema.cpp?rev=41635&r1=41634&r2=41635&view=diff
==============================================================================
--- cfe/trunk/Sema/Sema.cpp (original)
+++ cfe/trunk/Sema/Sema.cpp Thu Aug 30 23:53:24 2007
@@ -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.
//===----------------------------------------------------------------------===//
Modified: cfe/trunk/Sema/Sema.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Sema/Sema.h?rev=41635&r1=41634&r2=41635&view=diff
==============================================================================
--- cfe/trunk/Sema/Sema.h (original)
+++ cfe/trunk/Sema/Sema.h Thu Aug 30 23:53:24 2007
@@ -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.
//
Modified: cfe/trunk/include/clang/Parse/Action.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Parse/Action.h?rev=41635&r1=41634&r2=41635&view=diff
==============================================================================
--- cfe/trunk/include/clang/Parse/Action.h (original)
+++ cfe/trunk/include/clang/Parse/Action.h Thu Aug 30 23:53:24 2007
@@ -78,6 +78,12 @@
typedef ActionResult<1> StmtResult;
typedef ActionResult<2> TypeResult;
+ /// Deletion callbacks - Since the parser doesn't know the concrete types of
+ /// the AST nodes being generated, it must do callbacks to delete objects when
+ /// recovering from errors.
+ virtual void DeleteExpr(ExprTy *E) {}
+ virtual void DeleteStmt(StmtTy *E) {}
+
//===--------------------------------------------------------------------===//
// Declaration Tracking Callbacks.
//===--------------------------------------------------------------------===//
More information about the cfe-commits
mailing list