Initial commit
[SXSI/xpathcomp.git] / debug.ml
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 (******************************************************************************)
7
8 (* This file should not be compiled but included with INCLUDE. This requires
9    pa_macro.cmo to be loaded (see Makefile)
10 *)
11
12 IFNDEF DEBUG__ML__
13 THEN
14 DEFINE DEBUG__ML__
15
16 IFDEF DEBUG
17 THEN 
18 module Loc = Camlp4.PreCast.Loc
19
20
21 DEFINE D(x) = ignore(x);
22
23 DEFINE MM(v,l) = Memory.register v (Loc.to_string (l))
24 let () = Memory.schedule_stats ()
25
26
27 ELSE
28
29 DEFINE D(x) = ();
30 DEFINE MM(v,l) = ()
31
32 END (* IFDEF DEBUG *)
33
34 IFDEF PROFILE
35 THEN DEFINE P(x) = ignore(x);
36 ELSE DEFINE P(x) = ();
37 END (* IFDEF DEBUG *)
38
39
40
41 END (* IFNDEF DEBUG__ML__ *)