method vvdec v =
if isArrayType v.vtype && not (VarinfoSet.mem v !varset) then
begin
assert (not v.vformal);
VarinfoHashtbl.add var_to_array_type v v.vtype;
let elemty = element_type v.vtype in
(* Store information that variable was originally of array type *)
varset := VarinfoSet.add v !varset;
(* Change the variable type *)
let newty =
if array_size v.vtype > 0L then
begin
(* Change the type into "reference" type, that behaves almost like
* a pointer, except validity is ensured.
*)
let size = constant_expr (array_size v.vtype) in
(* Schedule for allocation *)
allocvarset := VarinfoSet.add v !allocvarset;
mkTRefArray(elemty,size,[]);
end
else
(* Plain pointer type to array with zero size *)
TPtr(v.vtype,[]);
in
attach_globaction (fun () -> v.vtype <- newty);
(* Create a "straw" variable for this variable, with the correct type *)
let strawv = makePseudoVar newty in
VarinfoHashtbl.add var_to_strawvar v strawv;
VarinfoHashtbl.add strawvar_to_var strawv v;
end;
DoChildren