diff options
author | Damien Doligez <damien.doligez-inria.fr> | 1998-05-23 14:12:38 +0000 |
---|---|---|
committer | Damien Doligez <damien.doligez-inria.fr> | 1998-05-23 14:12:38 +0000 |
commit | 0aa9eb4f80b0b69ac75c85b3381fd2008b55c46f (patch) | |
tree | 36ce00cc2d0efee873e0597e30c10b94cc890957 | |
parent | 37102825007d3090cdb79a7b0d4074ecbd24c092 (diff) |
fix: profiling.cmo non linke
fix: probleme de redefinition de (+)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@1964 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r-- | tools/ocamlcp.ml | 2 | ||||
-rw-r--r-- | tools/ocamlprof.ml | 23 |
2 files changed, 13 insertions, 12 deletions
diff --git a/tools/ocamlcp.ml b/tools/ocamlcp.ml index 5daa46c55..c43296097 100644 --- a/tools/ocamlcp.ml +++ b/tools/ocamlcp.ml @@ -75,6 +75,6 @@ let _ = Sys.command (Printf.sprintf "ocamlc -pp \"ocamlprof -instrument %s\" %s %s" (String.concat " " (List.rev !profargs)) - (if !make_archive then "profiling.cmo" else "") + (if !make_archive then "" else "profiling.cmo") (String.concat " " (List.rev !compargs))) in exit status diff --git a/tools/ocamlprof.ml b/tools/ocamlprof.ml index 6dbcdbb4b..70a9c67d2 100644 --- a/tools/ocamlprof.ml +++ b/tools/ocamlprof.ml @@ -53,7 +53,7 @@ let insert_action = ref (function x -> () : int -> unit) (* Producing instrumented code *) let add_incr_counter mod_name prof_counter = fprintf !outchan - "profile_%s_.(%d) <- profile_%s_.(%d) + 1; " + "profile_%s_.(%d) <- Pervasives.succ profile_%s_.(%d); " mod_name prof_counter mod_name prof_counter let counters = ref (Array.create 0 0) @@ -74,17 +74,18 @@ let add_val_counter prof_counter = () let insert_profile rewrite_exp ({pexp_loc={loc_start=st; loc_end=en}} as ex) = - if !instr_mode then begin + if st = en then + rewrite_exp ex + else begin copy st; - output_string !outchan "(" - end; - copy st; - !insert_action !profile_counter; - incr profile_counter; - rewrite_exp ex; - if !instr_mode then begin - copy en; - output_string !outchan ")" + if !instr_mode then output_string !outchan "("; + !insert_action !profile_counter; + incr profile_counter; + rewrite_exp ex; + if !instr_mode then begin + copy en; + output_string !outchan ")" + end end ;; |