Project

General

Profile

Revision 53206908 src/types.ml

View differences:

src/types.ml
198 198
  | Tstruct fl -> (try Some (List.assoc label fl) with Not_found -> None)
199 199
  | _          -> None
200 200

  
201
let is_numeric_type ty =
201
let rec is_scalar_type ty =
202
  match (repr ty).tdesc with
203
  | Tstatic (_, ty) -> is_scalar_type ty
204
  | Tbool
205
  | Tint
206
  | Treal -> true
207
  | _     -> false
208

  
209
let rec is_numeric_type ty =
202 210
 match (repr ty).tdesc with
211
 | Tstatic (_, ty) -> is_numeric_type ty
203 212
 | Tint
204 213
 | Treal -> true
205 214
 | _     -> false
206 215

  
207
let is_bool_type ty =
216
let rec is_real_type ty =
217
 match (repr ty).tdesc with
218
 | Tstatic (_, ty) -> is_real_type ty
219
 | Treal -> true
220
 | _     -> false
221

  
222
let rec is_bool_type ty =
208 223
 match (repr ty).tdesc with
224
 | Tstatic (_, ty) -> is_bool_type ty
209 225
 | Tbool -> true
210 226
 | _     -> false
211 227

  
......
288 304
  | _                -> ty
289 305

  
290 306
let is_address_type ty =
291
  is_array_type ty || is_struct_type ty
307
  is_array_type ty || is_struct_type ty || (is_real_type ty && !Options.mpfr)
292 308

  
293 309
let rec is_generic_type ty =
294 310
 match (dynamic_type ty).tdesc with
......
313 329
  else
314 330
    List.hd tyl
315 331

  
316
let type_list_of_type ty =
332
let rec type_list_of_type ty =
317 333
 match (repr ty).tdesc with
318
 | Ttuple tl -> tl
319
 | _         -> [ty]
334
 | Tstatic (_, ty) -> type_list_of_type ty
335
 | Ttuple tl       -> tl
336
 | _               -> [ty]
320 337

  
321 338
(** [is_polymorphic ty] returns true if [ty] is polymorphic. *)
322 339
let rec is_polymorphic ty =

Also available in: Unified diff