summaryrefslogtreecommitdiffstats
path: root/bytecomp/printlambda.ml
diff options
context:
space:
mode:
authorLuc Maranget <luc.maranget@inria.fr>2001-02-19 20:27:52 +0000
committerLuc Maranget <luc.maranget@inria.fr>2001-02-19 20:27:52 +0000
commiteb7578b8db11dbed6960a35abab066ca514592ff (patch)
treead68142169fee502c7f60d073af69121c726495d /bytecomp/printlambda.ml
parenta9c4a16caaac6a3fe6907dd87cc63366fc492ef8 (diff)
optimsation pm a donf
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@3427 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'bytecomp/printlambda.ml')
-rw-r--r--bytecomp/printlambda.ml26
1 files changed, 14 insertions, 12 deletions
diff --git a/bytecomp/printlambda.ml b/bytecomp/printlambda.ml
index dd0098b1d..568ef83c2 100644
--- a/bytecomp/printlambda.ml
+++ b/bytecomp/printlambda.ml
@@ -225,24 +225,26 @@ let rec lam ppf = function
if !spc then fprintf ppf "@ " else spc := true;
fprintf ppf "@[<hv 1>case int %i:@ %a@]" n lam l)
sw.sw_consts;
- List.iter
- (fun (n, l) ->
- if !spc then fprintf ppf "@ " else spc := true;
- fprintf ppf "@[<hv 1>case tag %i:@ %a@]" n lam l)
- sw.sw_blocks in
+ List.iter
+ (fun (n, l) ->
+ if !spc then fprintf ppf "@ " else spc := true;
+ fprintf ppf "@[<hv 1>case tag %i:@ %a@]" n lam l)
+ sw.sw_blocks ;
+ begin match sw.sw_failaction with
+ | None -> ()
+ | Some l ->
+ if !spc then fprintf ppf "@ " else spc := true;
+ fprintf ppf "@[<hv 1>default:@ %a@]" lam l
+ end in
+
fprintf ppf
- "@[<1>(%s%s%a@ @[<v 0>%a@])@]"
- (if sw.sw_checked then "switch-checked" else "switch")
- (if sw.sw_nofail then "* " else " ")
+ "@[<1>(%s %a@ @[<v 0>%a@])@]"
+ (match sw.sw_failaction with None -> "switch*" | _ -> "switch")
lam larg switch sw
- | Lstaticfail ->
- fprintf ppf "exit"
| Lstaticraise (i, ls) ->
let lams ppf largs =
List.iter (fun l -> fprintf ppf "@ %a" lam l) largs in
fprintf ppf "@[<2>(exit@ %d%a)@]" i lams ls;
- | Lcatch(lbody, lhandler) ->
- fprintf ppf "@[<2>(catch@ %a@;<1 -1>with@ %a)@]" lam lbody lam lhandler
| Lstaticcatch(lbody, (i, vars), lhandler) ->
fprintf ppf "@[<2>(catch@ %a@;<1 -1>with (%d%a)@ %a)@]"
lam lbody i