summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuc Maranget <luc.maranget@inria.fr>2005-03-11 12:50:45 +0000
committerLuc Maranget <luc.maranget@inria.fr>2005-03-11 12:50:45 +0000
commit3d448065a6994cb64833e283c40e0992ea45280b (patch)
treeda931ee6add5b407adb5eb837bf8703dfba444db
parent3135e5fd7692fc123478c2c098fd1a58db194db0 (diff)
Hum, some printout code left
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@6812 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r--bytecomp/matching.ml14
1 files changed, 12 insertions, 2 deletions
diff --git a/bytecomp/matching.ml b/bytecomp/matching.ml
index f436e1f14..d24be42f1 100644
--- a/bytecomp/matching.ml
+++ b/bytecomp/matching.ml
@@ -101,6 +101,10 @@ let rshift_num n {left=left ; right=right} =
let ctx_rshift_num n ctx = List.map (rshift_num n) ctx
+(* Recombination of contexts (eg: (_,_)::p1::p2::rem -> (p1,p2)::rem)
+ All mutable fields are replaced by '_', since side-effects in
+ guards can alter these fields *)
+
let combine {left=left ; right=right} = match left with
| p::ps -> {left=ps ; right=set_args_erase_mutable p right}
| _ -> assert false
@@ -2356,7 +2360,11 @@ and compile_no_test divide up_ctx repr partial ctx to_match =
(* The entry points *)
-(* had toplevel handler when appropriate *)
+(*
+ If there is a guard in a matching, then
+ set exhaustiveness info to Partial.
+ (because of side effects in guards, assume the worst)
+*)
let check_partial pat_act_list partial =
if
@@ -2364,11 +2372,13 @@ let check_partial pat_act_list partial =
(fun (_,lam) -> is_guarded lam)
pat_act_list
then begin
- prerr_endline "CHANGE" ;
Partial
end else
partial
+
+(* have toplevel handler when appropriate *)
+
let start_ctx n = [{left=[] ; right = omegas n}]
let check_total total lambda i handler_fun =