method vfunc f =
    (* First change type of local structure variables *)
    List.iter (ignore $ visitFramacVarDecl (self:>frama_c_visitor)) f.slocals;
    List.iter (ignore $ visitFramacVarDecl (self:>frama_c_visitor)) f.sformals;
    (* Then allocate/deallocate memory for those that need it *)
    List.iter (fun v ->
      if VarinfoSet.mem v !varset then
        let ast = mkalloc_statement v (pointed_type v.vtype) v.vdecl in
        add_pending_statement ~beginning:true ast;
        (* do not deallocate variable used in returning a structure *)
        if not (VarinfoHashtbl.mem return_vars v) then
          let fst = mkfree_statement v v.vdecl in
          add_pending_statement ~beginning:false fst
    ) f.slocals;
    DoChildren