method vtype t = match t with
| TNamed(ti,_) ->
if Hashtbl.mem used_typeinfo ti.tname then SkipChildren
else begin
debug "[sparecode:globs] add used typedef %s@." ti.tname;
Hashtbl.add used_typeinfo ti.tname ();
ignore (visitCilType (self:>Cil.cilVisitor) ti.ttype);
DoChildren
end
| TEnum(ei,_) ->
if Hashtbl.mem used_enuminfo ei.ename then SkipChildren
else begin
debug "[sparecode:globs] add used enum %s@." ei.ename;
Hashtbl.add used_enuminfo ei.ename (); DoChildren
end
| TComp(ci,_,_) ->
if Hashtbl.mem used_compinfo ci.cname then SkipChildren
else begin
debug "[sparecode:globs] add used comp %s@." ci.cname;
Hashtbl.add used_compinfo ci.cname ();
List.iter
(fun f -> ignore (visitCilType (self:>Cil.cilVisitor) f.ftype))
ci.cfields;
DoChildren
end
| _ -> DoChildren