summaryrefslogtreecommitdiff
path: root/tools/ocamlprof.ml
diff options
context:
space:
mode:
authorFabrice Le Fessant <Fabrice.Le_fessant@inria.fr>2012-05-30 14:52:37 +0000
committerFabrice Le Fessant <Fabrice.Le_fessant@inria.fr>2012-05-30 14:52:37 +0000
commitd39d43e55fab716fbe05cec3c89233f0dd208835 (patch)
treebf5c56aa9bb32a0e3d49509b8b2863a9ec407563 /tools/ocamlprof.ml
parente3d82817909dd7bc69dff4f75aa63c5ba606d9c8 (diff)
downloadocaml-d39d43e55fab716fbe05cec3c89233f0dd208835.tar.gz
merge with branch bin-annot
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12516 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'tools/ocamlprof.ml')
-rw-r--r--tools/ocamlprof.ml21
1 files changed, 11 insertions, 10 deletions
diff --git a/tools/ocamlprof.ml b/tools/ocamlprof.ml
index b8a6b3fa40..1fd123ceab 100644
--- a/tools/ocamlprof.ml
+++ b/tools/ocamlprof.ml
@@ -282,8 +282,8 @@ and rw_exp iflag sexp =
| Pexp_poly (sexp, _) -> rewrite_exp iflag sexp
- | Pexp_object (_, fieldl) ->
- List.iter (rewrite_class_field iflag) fieldl
+ | Pexp_object cl ->
+ List.iter (rewrite_class_field iflag) cl.pcstr_fields
| Pexp_newtype (_, sexp) -> rewrite_exp iflag sexp
| Pexp_open (_, e) -> rewrite_exp iflag e
@@ -319,24 +319,25 @@ and rewrite_trymatching l =
(* Rewrite a class definition *)
-and rewrite_class_field iflag =
- function
+and rewrite_class_field iflag cf =
+ match cf.pcf_desc with
Pcf_inher (_, cexpr, _) -> rewrite_class_expr iflag cexpr
- | Pcf_val (_, _, _, sexp, _) -> rewrite_exp iflag sexp
- | Pcf_meth (_, _, _, ({pexp_desc = Pexp_function _} as sexp), _) ->
+ | Pcf_val (_, _, _, sexp) -> rewrite_exp iflag sexp
+ | Pcf_meth (_, _, _, ({pexp_desc = Pexp_function _} as sexp)) ->
rewrite_exp iflag sexp
- | Pcf_meth (_, _, _, sexp, loc) ->
+ | Pcf_meth (_, _, _, sexp) ->
+ let loc = cf.pcf_loc in
if !instr_fun && not loc.loc_ghost then insert_profile rw_exp sexp
else rewrite_exp iflag sexp
| Pcf_init sexp ->
rewrite_exp iflag sexp
- | Pcf_valvirt _ | Pcf_virt _ | Pcf_cstr _ -> ()
+ | Pcf_valvirt _ | Pcf_virt _ | Pcf_constr _ -> ()
and rewrite_class_expr iflag cexpr =
match cexpr.pcl_desc with
Pcl_constr _ -> ()
- | Pcl_structure (_, fields) ->
- List.iter (rewrite_class_field iflag) fields
+ | Pcl_structure st ->
+ List.iter (rewrite_class_field iflag) st.pcstr_fields
| Pcl_fun (_, _, _, cexpr) ->
rewrite_class_expr iflag cexpr
| Pcl_apply (cexpr, exprs) ->