From 36d07e0a6f5128fbfb0065aa315d91a852f844ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9cile=20RUET-CROS?= <cecile.ruet-cros@cea.fr> Date: Mon, 23 Sep 2024 18:20:55 +0200 Subject: [PATCH] [region] make lint --- src/plugins/region/Region.mli | 60 +++++++++++++++++------------------ src/plugins/region/memory.ml | 30 +++++++++--------- 2 files changed, 45 insertions(+), 45 deletions(-) diff --git a/src/plugins/region/Region.mli b/src/plugins/region/Region.mli index 8630768bdae..0cb9157484f 100644 --- a/src/plugins/region/Region.mli +++ b/src/plugins/region/Region.mli @@ -29,48 +29,48 @@ open Cil_types (* Lower level API - more efficient *) module Node : sig (* General type *) - type node - type map + type node + type map - (* API GETTERS *) - val get_map : kernel_function -> map + (* API GETTERS *) + val get_map : kernel_function -> map - val get_id : map -> node -> int - val get_node : map -> int -> node + val get_id : map -> node -> int + val get_node : map -> int -> node - val cvar : map -> varinfo -> node - val field : map -> node -> fieldinfo -> node - val shift : map -> node -> typ -> node + val cvar : map -> varinfo -> node + val field : map -> node -> fieldinfo -> node + val shift : map -> node -> typ -> node - val base_addr : map -> node -> node + val base_addr : map -> node -> node - (* API POINTERS *) - val points_to : map -> node -> node option - val pointed_by : map -> node -> node list + (* API POINTERS *) + val points_to : map -> node -> node option + val pointed_by : map -> node -> node list - (* COMPARATOR *) - val separated : map -> node -> node -> bool - val included : map -> node -> node -> bool - val equal : map -> node -> node -> bool + (* COMPARATOR *) + val separated : map -> node -> node -> bool + val included : map -> node -> node -> bool + val equal : map -> node -> node -> bool - (* API ITERATOR *) - val iter : map -> (node -> unit) -> unit + (* API ITERATOR *) + val iter : map -> (node -> unit) -> unit - (* API PRINTER *) - val pp_node : Format.formatter -> node -> unit + (* API PRINTER *) + val pp_node : Format.formatter -> node -> unit - (* API ACCESS *) - type acs = { - acs_read : typ list; - acs_write : typ list; - acs_shift : typ list; - } - val empty_acs : acs - val accesses : map -> node -> acs + (* API ACCESS *) + type acs = { + acs_read : typ list; + acs_write : typ list; + acs_shift : typ list; + } + val empty_acs : acs + val accesses : map -> node -> acs end @@ -78,7 +78,7 @@ end (* High level API *) module Region : sig -(* General type *) + (* General type *) type region type map diff --git a/src/plugins/region/memory.ml b/src/plugins/region/memory.ml index 99689473aa6..b44446ba65d 100644 --- a/src/plugins/region/memory.ml +++ b/src/plugins/region/memory.ml @@ -344,21 +344,21 @@ let iter (m:map) (f: region -> unit) = let h = Hashtbl.create 0 in Vmap.iter (fun _x n -> walk h m f n) m.roots - let rec walk_node h m (f: node -> unit) n = - let n = Ufind.find m.store n in - let id = Store.id n in - try Hashtbl.find h id with Not_found -> - Hashtbl.add h id () ; - f n ; - let r = Ufind.get m.store n in - match r.clayout with - | Blob -> () - | Cell(_,p) -> Option.iter (walk_node h m f) p - | Compound(_,_,rg) -> Ranges.iter (walk_node h m f) rg - - let iter_node (m:map) (f: node -> unit) = - let h = Hashtbl.create 0 in - Vmap.iter (fun _x n -> walk_node h m f n) m.roots +let rec walk_node h m (f: node -> unit) n = + let n = Ufind.find m.store n in + let id = Store.id n in + try Hashtbl.find h id with Not_found -> + Hashtbl.add h id () ; + f n ; + let r = Ufind.get m.store n in + match r.clayout with + | Blob -> () + | Cell(_,p) -> Option.iter (walk_node h m f) p + | Compound(_,_,rg) -> Ranges.iter (walk_node h m f) rg + +let iter_node (m:map) (f: node -> unit) = + let h = Hashtbl.create 0 in + Vmap.iter (fun _x n -> walk_node h m f n) m.roots let regions map = let pool = ref [] in -- GitLab