add actions for deleting expr/stmt nodes.
llvm-svn: 41635
This commit is contained in:
parent
9e47ead594
commit
57c523f50c
|
@ -38,6 +38,13 @@ Sema::Sema(Preprocessor &pp, ASTContext &ctxt, std::vector<Decl*> &prevInGroup)
|
|||
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.
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
|
|
@ -120,6 +120,9 @@ public:
|
|||
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.
|
||||
//
|
||||
|
|
|
@ -78,6 +78,12 @@ public:
|
|||
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.
|
||||
//===--------------------------------------------------------------------===//
|
||||
|
|
Loading…
Reference in New Issue