diff options
author | Gabriel Scherer <gabriel.scherer@gmail.com> | 2015-04-12 18:26:38 +0000 |
---|---|---|
committer | Gabriel Scherer <gabriel.scherer@gmail.com> | 2015-04-12 18:26:38 +0000 |
commit | 90061455e628fddde017085892f815d0fc3f8f6d (patch) | |
tree | ef3ff2f85ed9c27c25ec8b552baad05e77cd6f55 /bytecomp/printlambda.ml | |
parent | 4530ee379ce673ef741970bd2db0c6f3eb942ab6 (diff) | |
download | ocaml-90061455e628fddde017085892f815d0fc3f8f6d.tar.gz |
GPR#111: `(f [@taillcall]) x y` warns if `f x y` is not a tail-call
(Simon Cruanes)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16010 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'bytecomp/printlambda.ml')
-rw-r--r-- | bytecomp/printlambda.ml | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/bytecomp/printlambda.ml b/bytecomp/printlambda.ml index b4d4d3bd37..591822f3b8 100644 --- a/bytecomp/printlambda.ml +++ b/bytecomp/printlambda.ml @@ -254,6 +254,10 @@ let rec lam ppf = function Ident.print ppf id | Lconst cst -> struct_const ppf cst + | Lapply(lfun, largs, info) when info.apply_should_be_tailcall -> + let lams ppf largs = + List.iter (fun l -> fprintf ppf "@ %a" lam l) largs in + fprintf ppf "@[<2>(apply@ %a%a @@tailcall)@]" lam lfun lams largs | Lapply(lfun, largs, _) -> let lams ppf largs = List.iter (fun l -> fprintf ppf "@ %a" lam l) largs in |