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.
This commit is contained in:
parent
b7b9f9f511
commit
252a151fc6
1 changed files with 0 additions and 4 deletions
4
tccpp.c
4
tccpp.c
|
@ -3203,14 +3203,11 @@ static void line_macro_output(BufferedFile *f, const char *s, TCCState *s1)
|
||||||
/* Preprocess the current file */
|
/* Preprocess the current file */
|
||||||
ST_FUNC int tcc_preprocess(TCCState *s1)
|
ST_FUNC int tcc_preprocess(TCCState *s1)
|
||||||
{
|
{
|
||||||
Sym *define_start;
|
|
||||||
|
|
||||||
BufferedFile *file_ref, **iptr, **iptr_new;
|
BufferedFile *file_ref, **iptr, **iptr_new;
|
||||||
int token_seen, d;
|
int token_seen, d;
|
||||||
const char *s;
|
const char *s;
|
||||||
|
|
||||||
preprocess_init(s1);
|
preprocess_init(s1);
|
||||||
define_start = define_stack;
|
|
||||||
ch = file->buf_ptr[0];
|
ch = file->buf_ptr[0];
|
||||||
tok_flags = TOK_FLAG_BOL | TOK_FLAG_BOF;
|
tok_flags = TOK_FLAG_BOL | TOK_FLAG_BOF;
|
||||||
parse_flags = PARSE_FLAG_ASM_COMMENTS | PARSE_FLAG_PREPROCESS |
|
parse_flags = PARSE_FLAG_ASM_COMMENTS | PARSE_FLAG_PREPROCESS |
|
||||||
|
@ -3258,6 +3255,5 @@ print_line:
|
||||||
}
|
}
|
||||||
fputs(get_tok_str(tok, &tokc), s1->ppfp);
|
fputs(get_tok_str(tok, &tokc), s1->ppfp);
|
||||||
}
|
}
|
||||||
free_defines(define_start);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue