summaryrefslogtreecommitdiff
path: root/asmcomp/liveness.ml
diff options
context:
space:
mode:
authorLuc Maranget <luc.maranget@inria.fr>2000-08-11 19:50:59 +0000
committerLuc Maranget <luc.maranget@inria.fr>2000-08-11 19:50:59 +0000
commitd043fecf185164dcb2114e3617345624caeb28c8 (patch)
tree6603bc4a816c58efa6b3b9d831a8e0e19190da3c /asmcomp/liveness.ml
parent3ad649f365636b4f39e26d96b23eb8ddfc4101d2 (diff)
downloadocaml-d043fecf185164dcb2114e3617345624caeb28c8.tar.gz
new or-pat compilation + exhaustiveness used in compilation
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@3273 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'asmcomp/liveness.ml')
-rw-r--r--asmcomp/liveness.ml26
1 files changed, 17 insertions, 9 deletions
diff --git a/asmcomp/liveness.ml b/asmcomp/liveness.ml
index fcbb208390..c9c90c8b59 100644
--- a/asmcomp/liveness.ml
+++ b/asmcomp/liveness.ml
@@ -17,7 +17,13 @@
open Mach
-let live_at_exit = ref Reg.Set.empty
+let live_at_exit = ref []
+let find_live_at_exit k =
+ try
+ List.assoc k !live_at_exit
+ with
+ | Not_found -> Misc.fatal_error "Spill.find_live_at_exit"
+
let live_at_break = ref Reg.Set.empty
let live_at_raise = ref Reg.Set.empty
@@ -62,18 +68,20 @@ let rec live i finally =
end;
i.live <- !at_top;
!at_top
- | Icatch(body, handler) ->
+ | Icatch(nfail, body, handler) ->
let at_join = live i.next finally in
let before_handler = live handler at_join in
- let saved_live_at_exit = !live_at_exit in
- live_at_exit := before_handler;
- let before_body = live body at_join in
- live_at_exit := saved_live_at_exit;
+ let before_body =
+ live_at_exit := (nfail,before_handler) :: !live_at_exit ;
+ let before_body = live body at_join in
+ live_at_exit := List.tl !live_at_exit ;
+ before_body in
i.live <- before_body;
before_body
- | Iexit ->
- i.live <- !live_at_exit; (* These regs are live across *)
- !live_at_exit
+ | Iexit nfail ->
+ let this_live = find_live_at_exit nfail in
+ i.live <- this_live ;
+ this_live
| Itrywith(body, handler) ->
let at_join = live i.next finally in
let before_handler = live handler at_join in