Attention une mise à jour du service Gitlab va être effectuée le mardi 14 décembre entre 13h30 et 14h00. Cette mise à jour va générer une interruption du service dont nous ne maîtrisons pas complètement la durée mais qui ne devrait pas excéder quelques minutes.

Commit 8064e3c4 authored by Andrei Paskevich's avatar Andrei Paskevich
Browse files

minor

parent 9fd9469c
...@@ -268,27 +268,25 @@ let reg_occurs r vars = reg_any (reg_equal r) vars ...@@ -268,27 +268,25 @@ let reg_occurs r vars = reg_any (reg_equal r) vars
(* detect non-ghost type variables and regions *) (* detect non-ghost type variables and regions *)
let rec ity_nonghost_reg regs ity = match ity.ity_node with let rec fold_nonghost on_reg acc ity =
| _ when ity_immutable ity -> regs let fn = fold_nonghost on_reg in
| Ityvar _ -> regs if ity_immutable ity then acc
| Itypur (_,tl) -> List.fold_left ity_nonghost_reg regs tl else match ity.ity_node with
| Ityvar _ -> acc
| Itypur (_,tl) ->
List.fold_left fn acc tl
| Ityapp ({ its_ghrl = ghrl },tl,rl) -> | Ityapp ({ its_ghrl = ghrl },tl,rl) ->
let regs = List.fold_left ity_nonghost_reg regs tl in let acc = List.fold_left fn acc tl in
List.fold_left2 (fun s gh ({ reg_ity = ity } as r) -> List.fold_left2 (fun s gh ({ reg_ity = ity } as r) ->
if gh then s else ity_nonghost_reg (Sreg.add r s) ity) regs ghrl rl if gh then s else fn (on_reg r s) ity) acc ghrl rl
let ity_nonghost_reg regs ity = fold_nonghost Sreg.add regs ity
let lookup_nonghost_reg regs ity = let lookup_nonghost_reg regs ity =
let rec any ity = match ity.ity_node with
| _ when ity_immutable ity -> ()
| Ityvar _ -> ()
| Itypur (_,tl) -> List.iter any tl
| Ityapp ({ its_ghrl = ghrl },tl,rl) ->
List.iter any tl;
List.iter2 (fun gh ({ reg_ity = ity } as r) -> if not gh then
(if Sreg.mem r regs then raise Util.FoldSkip else any ity)) ghrl rl
in
if reg_any (fun r -> Sreg.mem r regs) ity.ity_vars if reg_any (fun r -> Sreg.mem r regs) ity.ity_vars
then try any ity; false with Util.FoldSkip -> true then try fold_nonghost (fun r acc ->
if Sreg.mem r regs then raise Util.FoldSkip else acc) false ity
with Util.FoldSkip -> true
else false else false
(* smart constructors *) (* smart constructors *)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment