method vglob_aux = function
| GVar (_,_,_) as g ->
let postaction = function
| [GVar (v,_,_)] ->
if VarinfoSet.mem v !varset then
let ast = mkalloc_statement v (pointed_type v.vtype) v.vdecl in
attach_globinit ast;
let p =
Pvalid_range(
variable_term v.vdecl (cvar_to_lvar v),
constant_term v.vdecl 0L,
constant_term v.vdecl 0L)
in
let globinv =
Cil_const.make_logic_info (unique_logic_name ("valid_" ^ v.vname))
in
globinv.l_labels <- [ LogicLabel "Here" ];
globinv.l_body <- LBpred (predicate v.vdecl p);
attach_globaction
(fun () -> Logic_utils.add_logic_function globinv);
[g; GAnnot(Dinvariant globinv,v.vdecl)]
else [g]
| _ -> assert false
in
ChangeDoChildrenPost ([g], postaction)
| GVarDecl _ | GFun _ | GAnnot _ -> DoChildren
| GCompTag _ | GType _ | GCompTagDecl _ | GEnumTagDecl _
| GEnumTag _ | GAsm _ | GPragma _ | GText _ -> SkipChildren