let rec size_of_type ~env t =
match t.ct_ty with
Tvoid -> None
| Tbuiltin bt ->
Some (big_int_of_int (size_of_builtin_type bt))
| Tarray(et,None) -> None
| Tarray(et,Some s) -> begin
match size_of_type ~env et with
Some t -> Some (mult_big_int t s)
| None -> None
end
| Tfunction(_) -> None
| Tpointer(_) -> Some (big_int_of_int sizeof_pointer)
| Tstruct(id) ->
let sd = get_struct_desc ~env id in
sd.str_size