summaryrefslogtreecommitdiff
path: root/asmcomp/reg.ml
diff options
context:
space:
mode:
Diffstat (limited to 'asmcomp/reg.ml')
-rw-r--r--asmcomp/reg.ml10
1 files changed, 10 insertions, 0 deletions
diff --git a/asmcomp/reg.ml b/asmcomp/reg.ml
index a0fc7dfffa..ef6db5cb6e 100644
--- a/asmcomp/reg.ml
+++ b/asmcomp/reg.ml
@@ -178,6 +178,16 @@ let inter_set_array s v =
else inter_all(i+1)
in inter_all 0
+let disjoint_set_array s v =
+ match Array.length v with
+ 0 -> true
+ | 1 -> not (Set.mem v.(0) s)
+ | n -> let rec disjoint_all i =
+ if i >= n then true
+ else if Set.mem v.(i) s then false
+ else disjoint_all (i+1)
+ in disjoint_all 0
+
let set_of_array v =
match Array.length v with
0 -> Set.empty