optimization of the previous patch

compilation speed of the tccboot restored
    (patch remove testing of the parse_flags in loop)
master
seyko 2016-04-05 11:19:09 +03:00
parent d3e85e80fd
commit 5a704457e2
1 changed files with 6 additions and 4 deletions

10
tccpp.c
View File

@ -2463,8 +2463,9 @@ maybe_newline:
p1 = p; p1 = p;
h = TOK_HASH_INIT; h = TOK_HASH_INIT;
h = TOK_HASH_FUNC(h, c); h = TOK_HASH_FUNC(h, c);
while (c = *++p, (isidnum_table[c - CH_EOF] & (IS_ID|IS_NUM)) isidnum_table['.' - CH_EOF] =
|| (c == '.' && (parse_flags & PARSE_FLAG_ASM_FILE))) (parse_flags & PARSE_FLAG_ASM_FILE) ? IS_ID : 0;
while (c = *++p, isidnum_table[c - CH_EOF] & (IS_ID|IS_NUM))
h = TOK_HASH_FUNC(h, c); h = TOK_HASH_FUNC(h, c);
if (c != '\\') { if (c != '\\') {
TokenSym **pts; TokenSym **pts;
@ -2496,8 +2497,7 @@ maybe_newline:
p--; p--;
PEEKC(c, p); PEEKC(c, p);
parse_ident_slow: parse_ident_slow:
while ((isidnum_table[c - CH_EOF] & (IS_ID|IS_NUM)) while (isidnum_table[c - CH_EOF] & (IS_ID|IS_NUM))
|| (c == '.' && (parse_flags & PARSE_FLAG_ASM_FILE)))
{ {
cstr_ccat(&tokcstr, c); cstr_ccat(&tokcstr, c);
PEEKC(c, p); PEEKC(c, p);
@ -2519,6 +2519,8 @@ maybe_newline:
} else { } else {
cstr_reset(&tokcstr); cstr_reset(&tokcstr);
cstr_ccat(&tokcstr, 'L'); cstr_ccat(&tokcstr, 'L');
isidnum_table['.' - CH_EOF] =
(parse_flags & PARSE_FLAG_ASM_FILE) ? IS_ID : 0;
goto parse_ident_slow; goto parse_ident_slow;
} }
} }