1 (******************************************************************************)
2 (* SXSI : XPath evaluator *)
3 (* Kim Nguyen (Kim.Nguyen@nicta.com.au) *)
4 (* Copyright NICTA 2008 *)
5 (* Distributed under the terms of the LGPL (see LICENCE) *)
6 (******************************************************************************)
8 (* This file should not be compiled but included with INCLUDE. This requires
9 pa_macro.cmo to be loaded (see Makefile)
18 module Loc = Camlp4.PreCast.Loc
20 DEFINE D_IGNORE_(e1,e2) = (let () = e1 in ();e2)
21 DEFINE D_IF_(e1,e2) = e1
22 DEFINE D_TRACE_(e) = e
26 DEFINE D_IGNORE_(e1,e2) = (e2)
27 DEFINE D_IF_(e1,e2) = e2
28 DEFINE D_TRACE_(e) = ()
35 DEFINE REGISTER_PROF_(s) = (Hashtbl.replace Profile.table ("", s) (ref (0, [])))
37 let ___tmp_t1 = Unix.gettimeofday () in
38 let ___tmp_result = e in
39 let ___tmp_t2 = Unix.gettimeofday () in
40 let ___r = Hashtbl.find Profile.table ("", s) in
41 let ___c,___tl = !___r in
42 ___r := (___c+1, ((___tmp_t2 -. ___tmp_t1) *. 1000.)::___tl);
46 DEFINE PROF_(s, e) = e
47 DEFINE REGISTER_PROF_(s) = ()
51 END (* IFNDEF DEBUG__ML__ *)