1 #ifndef FEATURES_H
2 #define FEATURES_H
3 
4 /*
5  * This file is for optional/temporary features. Note that good and
6  * non-debug code should NOT be controlled by these macros!
7  *
8  * Instead they are intended to make substantial and dangerous
9  * changes optional until they are tested and can be relied on
10  */
11 
12 
13 #define FEAT_DEBUG_DUMP_BOGUS_STORES	0
14 #define FEAT_AVOID_REG_STORES		0
15 
16 /*
17  * Enables immediate translation of functions and most global
18  * variables. That way less data structures must be kept around
19  * (assuming the zone allocator is also enabled)
20  *
21  * Saves VERY much memory. This should always be enabled
22  */
23 #define XLATE_IMMEDIATELY		1
24 
25 /*
26  * Enables zone allocator for all data structures pertaining to
27  * the translation of functions. This saves a lot of memory
28  *
29  * Should always be enabled
30  *
31  * 05/22/09: Not for the preprocessor! Maybe it should be enabled
32  * but the infrastructure is not there yet so we turn it off for
33  * now
34  */
35 #ifdef PREPROCESSOR
36 #    define USE_ZONE_ALLOCATOR		0
37 #else
38 #    define USE_ZONE_ALLOCATOR		(1 && XLATE_IMMEDIATELY)
39 #endif
40 
41 /*
42  * Don't use ``struct arrarg'' in type_node anymore to record
43  * array sizes. Now we always set arrarg_const immediately. That
44  * way the expr data structures can be freed
45  *
46  * Should always be enabled
47  */
48 #define REMOVE_ARRARG			1
49 
50 /*
51  * Does not use the stupid static float conversion buffer on x86
52  * and AMD64 anymore
53  *
54  * Should always be enabled
55  */
56 #define REMOVE_FLOATBUF			1
57 
58 
59 /*
60  * Evaluate constant arithmetic sub-expressions if possible
61  *
62  * Should always be enabled
63  *
64  * 05/22/09: Don't enable it for the preprocessor because the
65  * evaluation functions drag in icode functions, and it's
66  * probably completely unneeded in the preprocessor (we can
67  * only handle fully constant expressions, not partially
68  * constant ones)
69  */
70 #ifdef PREPROCESSOR
71 #    define EVAL_CONST_EXPR_CT		0
72 #else
73 #    define EVAL_CONST_EXPR_CT		1
74 #endif
75 
76 /*
77  * Removes many unnecessary register saves
78  *
79  * Should always be enabled, but will cause a lot of headache until
80  * debugged
81  */
82 #define AVOID_REGISTER_LEAKS		0
83 
84 /*
85  * Lookup of identifiers in the same pass as they're encountered. This
86  * fixes variable visibilty rules
87  *
88  * Should always be enabled
89  */
90 #define IMMEDIATE_SYMBOL_LOOKUP		1
91 
92 /*
93  * Removes the handling of multi-GPR register saving in free_preg().
94  * This may cause problems
95  */
96 #define AVOID_DUPED_MULTI_REG_SAVES	1
97 
98 /*
99  * This may be a huge can of worms... Don't set the 4 bytes max
100  * alignment limit on x86, but do it like gcc, i.e. give 8 bytes
101  * alignment to long long and double. Note that these values are
102  * configurable with -falign-double or somesuch!
103  */
104 #define ALIGN_X86_LIKE_GCC		1
105 
106 
107 /*
108  * 07/16/08: Since we deal with constant sub-expression evaluation
109  * more ``aggressively'' now, we may run into char and short constants,
110  * e.g. in
111  *
112  *     char func() { return (char)12; }
113  *
114  * ... here we could promote the operand to int, but that doesn't
115  * really make sense. So the int constant is converted to a char, and
116  * ends up being a constant token with type TY_CHAR
117  *
118  * The flag below teaches the emitters how to load such unexpected
119  * constants
120  */
121 #define ALLOW_CHAR_SHORT_CONSTANTS	1
122 
123 /*
124  * 05/13/09: First and foremost, this stuff is NOT fast! Maybe because
125  * we are not using it for struct declarations as well. But it is
126  * certainly not an improvement.
127  *
128  * Traditionally we only use hash tables for the global scope and scan
129  * lineary for nested scopes. On average this is no worse than the new
130  * lookup. This needs to be tested more, but it was probably a foolish
131  * micro optimization because of a few stupid profiler samples.
132  *
133  * It is DISABLED now because it STILL has bugs! Doesn't compile ftp.c
134  * of wget because of a huge bogus index (stack overflow?) in symlist.c
135  * on line 444
136  */
137 #define FAST_SYMBOL_LOOKUP		0
138 
139 /*
140  * 08/13/09
141  */
142 #define ZALLOC_USE_FREELIST		0
143 
144 #endif
145 
146