History

pp-many-files: don't drop a preprocessor defines when tcc going to preprocess a next file in the same pass like tcc -E one.c two.c three.c -o combined.i This will allow to speed up a compilation process by using a commamd like tcc -E *.c | tcc -o program.exe -xc -

It looks that multi-times initialization don't affect anything. Only call to the free_defines(define_start) in tcc_preprocess() is removed in assumption that free_defines(NULL) in tcc_cleanup() will free all defines.

seyko committed 11 years ago

Commit 252a1511 parent b7b9f9f1 file · +0 −4Browse files

Unified · Split

tccpp.c+0−4
@@ -3203,14 +3203,11 @@ static void line_macro_output(BufferedFile *f, const char *s, TCCState *s1) · 3202 unmodified lines
32033203 /* Preprocess the current file */
32043204 ST_FUNC int tcc_preprocess(TCCState *s1)
32053205 {
3206− Sym *define_start;
3207−
32083206 BufferedFile *file_ref, **iptr, **iptr_new;
32093207 int token_seen, d;
32103208 const char *s;
32113209
32123210 preprocess_init(s1);
3213− define_start = define_stack;
32143211 ch = file->buf_ptr[0];
32153212 tok_flags = TOK_FLAG_BOL | TOK_FLAG_BOF;
32163213 parse_flags = PARSE_FLAG_ASM_COMMENTS | PARSE_FLAG_PREPROCESS |
@@ -3258,6 +3255,5 @@ print_line: · 41 unmodified lines
32583255 }
32593256 fputs(get_tok_str(tok, &tokc), s1->ppfp);
32603257 }
3261− free_defines(define_start);
32623258 return 0;
32633259 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t