globalmaphack: be more general (fmap, factoring, ...)
[mate.git] / debug.h
1 /* DBG_JIT .... see generated code and CodeGen information
2  * DBG_BB ..... BasicBlock information
3  * DBG_MP ..... MethodPool.hs
4  * DBG_CP ..... ClassPool.hs
5  * DBG_STR .... Strings.hs
6  * // no printf* defined
7  * DBG_TRAP ... show information @ trap.c
8  * DBG_CLASS .. dump classfile
9  */
10
11 /* ooops defines */
12 #ifdef BG_ALL
13 #define DBG_ALL
14 #endif
15
16 #ifdef BG_JIT
17 #define DBG_JIT
18 #endif
19
20 #ifdef BG_BB
21 #define DBG_BB
22 #endif
23
24 #ifdef BG_MP
25 #define DBG_MP
26 #endif
27
28 #ifdef BG_CP
29 #define DBG_CP
30 #endif
31
32 #ifdef BG_STR
33 #define DBG_STR
34 #endif
35
36 #ifdef BG_TRAP
37 #define DBG_TRAP
38 #endif
39
40 #ifdef BG_CLASS
41 #define DBG_CLASS
42 #endif
43
44 /* if one constant from above is defined, we want to import
45  * libraries like Text.Printf
46  * needed for gettting proper `-Wall' output on a release build */
47
48 #if defined(DBG_ALL) || defined(DBG_JIT) || defined(DBG_BB) || defined(DBG_MP) || defined(DBG_CP) || defined(DBG_STR)
49 #define DEBUG
50 #endif
51
52 #if defined(DBG_ALL)
53 #define DBG_JIT
54 #define DBG_BB
55 #define DBG_MP
56 #define DBG_CP
57 #define DBG_STR
58 #define DBG_TRAP
59 #if 0
60 #define DBG_CLASS
61 #endif
62 #endif
63
64 /* it would be awesome if we could just write
65  * > printfFake = printf
66  * here, but the type can't be infered, since `PrintfType'
67  * isn't visible (at least this is my explanation :/).
68  * if I'm wrong, move this to `Mate/Debug.hs'
69  */
70 #ifdef DBG_JIT
71 #define printfJit printf
72 #endif
73
74 #ifdef DBG_BB
75 #define printfBb printf
76 #endif
77
78 #ifdef DBG_MP
79 #define printfMp printf
80 #endif
81
82 #ifdef DBG_CP
83 #define printfCp printf
84 #endif
85
86 #ifdef DBG_STR
87 #define printfStr printf
88 #endif