minor pp optimizations

* remove free_defines() from tcc_preprocess()
        all cleanup will be done in tcc_delete
    * move a preprocessor file closing to tcc_delete too
This commit is contained in:
seyko
2015-05-12 21:32:32 +03:00
parent 1234beccb8
commit 06e0753fce
3 changed files with 13 additions and 20 deletions

View File

@ -3332,12 +3332,10 @@ static void pp_line(TCCState *s1, BufferedFile *f, int level)
/* Preprocess the current file */
ST_FUNC int tcc_preprocess(TCCState *s1)
{
Sym *define_start;
BufferedFile **iptr;
int token_seen, spcs, level;
preprocess_init(s1);
define_start = define_stack;
ch = file->buf_ptr[0];
tok_flags = TOK_FLAG_BOL | TOK_FLAG_BOF;
parse_flags = PARSE_FLAG_PREPROCESS
@ -3388,6 +3386,5 @@ ST_FUNC int tcc_preprocess(TCCState *s1)
fputs(get_tok_str(tok, &tokc), s1->ppfp);
}
free_defines(define_start);
return 0;
}