let cast_loc_to_loc ty1 ty2 l =
    if Ctypes.equal (Ctypes.object_of ty1)(Ctypes.object_of ty2) then l
    else
      unsupported "cast from pointer (%a) to pointer (%a)"
        !Ast_printer.d_type ty1 !Ast_printer.d_type ty2