File tree Expand file tree Collapse file tree 1 file changed +33
-2
lines changed Expand file tree Collapse file tree 1 file changed +33
-2
lines changed Original file line number Diff line number Diff line change 19
19
#define MAX_PARAMS 8
20
20
#define MAX_LOCALS 1600
21
21
#define MAX_FIELDS 64
22
- #define MAX_TYPES 128
23
- #define MAX_IR_INSTR 60000
22
+ #define MAX_TYPES 256
23
+ #define MAX_IR_INSTR 80000
24
24
#define MAX_BB_PRED 128
25
25
#define MAX_BB_DOM_SUCC 64
26
26
#define MAX_BB_RDOM_SUCC 256
@@ -180,6 +180,37 @@ typedef enum {
180
180
T_cppd_pragma
181
181
} token_t ;
182
182
183
+ /* Source location tracking for better error reporting */
184
+ typedef struct {
185
+ int line ;
186
+ int column ;
187
+ char * filename ;
188
+ } source_location_t ;
189
+
190
+ /* Token structure with metadata for enhanced lexing */
191
+ typedef struct token_info {
192
+ token_t type ;
193
+ char value [MAX_TOKEN_LEN ];
194
+ source_location_t location ;
195
+ struct token_info * next ; /* For freelist management */
196
+ } token_info_t ;
197
+
198
+ /* Token freelist for memory reuse */
199
+ typedef struct {
200
+ token_info_t * freelist ;
201
+ int allocated_count ;
202
+ int reused_count ; /* Statistics for debugging */
203
+ } token_pool_t ;
204
+
205
+ /* Token buffer for improved lookahead */
206
+ #define TOKEN_BUFFER_SIZE 8
207
+ typedef struct {
208
+ token_info_t * tokens [TOKEN_BUFFER_SIZE ];
209
+ int head ;
210
+ int tail ;
211
+ int count ;
212
+ } token_buffer_t ;
213
+
183
214
/* builtin types */
184
215
typedef enum {
185
216
TYPE_void = 0 ,
You can’t perform that action at this time.
0 commit comments