public virtual void Visit(CiDelete stmt) { // do nothing - assume automatic garbage collector }
void ICiStatementVisitor.Visit(CiDelete statement) { statement.Expr = Resolve(statement.Expr); ICiPtrType type = statement.Expr.Type as ICiPtrType; if (type == null) throw new ResolveException("'delete' takes a class or array pointer"); if (statement.Expr.HasSideEffect) throw new ResolveException("Side effects not allowed in 'delete'"); this.WritablePtrTypes.Add(type); }
public override void Visit(CiDelete stmt) { Write("free("); Write(stmt.Expr); WriteLine(");"); }