Skip to content
Snippets Groups Projects
Commit 89681265 authored by Loïc Correnson's avatar Loïc Correnson
Browse files

[wp] type utilities

parent 159bca76
No related branches found
No related tags found
No related merge requests found
...@@ -226,6 +226,9 @@ let pp_object fmt = function ...@@ -226,6 +226,9 @@ let pp_object fmt = function
| C_comp _ -> Format.pp_print_string fmt "obj-struct/union" | C_comp _ -> Format.pp_print_string fmt "obj-struct/union"
| C_array _ -> Format.pp_print_string fmt "obj-array" | C_array _ -> Format.pp_print_string fmt "obj-array"
let i_name = i_memo (Pretty_utils.to_string pp_int)
let f_name = f_memo (Pretty_utils.to_string pp_float)
(* -------------------------------------------------------------------------- *) (* -------------------------------------------------------------------------- *)
(* --- Array Info --- *) (* --- Array Info --- *)
(* -------------------------------------------------------------------------- *) (* -------------------------------------------------------------------------- *)
...@@ -525,8 +528,8 @@ let promote a1 a2 = ...@@ -525,8 +528,8 @@ let promote a1 a2 =
"promotion between arithmetics and pointer types" "promotion between arithmetics and pointer types"
let rec basename = function let rec basename = function
| C_int i -> Format.asprintf "%a" pp_int i | C_int i -> i_name i
| C_float f -> Format.asprintf "%a" pp_float f | C_float f -> f_name f
| C_pointer _ -> "pointer" | C_pointer _ -> "pointer"
| C_comp c -> c.cname | C_comp c -> c.cname
| C_array a -> | C_array a ->
......
...@@ -142,6 +142,8 @@ val pp_int : Format.formatter -> c_int -> unit ...@@ -142,6 +142,8 @@ val pp_int : Format.formatter -> c_int -> unit
val pp_float : Format.formatter -> c_float -> unit val pp_float : Format.formatter -> c_float -> unit
val pp_object : Format.formatter -> c_object -> unit val pp_object : Format.formatter -> c_object -> unit
val i_name : c_int -> string
val f_name : c_float -> string
val basename : c_object -> string val basename : c_object -> string
val compare : c_object -> c_object -> int val compare : c_object -> c_object -> int
val equal : c_object -> c_object -> bool val equal : c_object -> c_object -> bool
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment