aboutsummaryrefslogtreecommitdiff
path: root/tccpp.c
diff options
context:
space:
mode:
authorseyko <seyko2@gmail.com>2016-04-05 11:19:09 +0300
committerseyko <seyko2@gmail.com>2016-04-05 11:19:09 +0300
commit5a704457e27a6024eb3bc2ca48b111d30ed7edf1 (patch)
treed9e0bde1bf72da78ad0c9b7643f492165a44d15b /tccpp.c
parentd3e85e80fd192d3fb19fa207bd6ce158a012b45a (diff)
downloadtinycc-5a704457e27a6024eb3bc2ca48b111d30ed7edf1.tar.gz
tinycc-5a704457e27a6024eb3bc2ca48b111d30ed7edf1.tar.bz2
optimization of the previous patch
compilation speed of the tccboot restored (patch remove testing of the parse_flags in loop)
Diffstat (limited to 'tccpp.c')
-rw-r--r--tccpp.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/tccpp.c b/tccpp.c
index cbc3707..260c9f4 100644
--- a/tccpp.c
+++ b/tccpp.c
@@ -2463,8 +2463,9 @@ maybe_newline:
p1 = p;
h = TOK_HASH_INIT;
h = TOK_HASH_FUNC(h, c);
- while (c = *++p, (isidnum_table[c - CH_EOF] & (IS_ID|IS_NUM))
- || (c == '.' && (parse_flags & PARSE_FLAG_ASM_FILE)))
+ isidnum_table['.' - CH_EOF] =
+ (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);
if (c != '\\') {
TokenSym **pts;
@@ -2496,8 +2497,7 @@ maybe_newline:
p--;
PEEKC(c, p);
parse_ident_slow:
- while ((isidnum_table[c - CH_EOF] & (IS_ID|IS_NUM))
- || (c == '.' && (parse_flags & PARSE_FLAG_ASM_FILE)))
+ while (isidnum_table[c - CH_EOF] & (IS_ID|IS_NUM))
{
cstr_ccat(&tokcstr, c);
PEEKC(c, p);
@@ -2519,6 +2519,8 @@ maybe_newline:
} else {
cstr_reset(&tokcstr);
cstr_ccat(&tokcstr, 'L');
+ isidnum_table['.' - CH_EOF] =
+ (parse_flags & PARSE_FLAG_ASM_FILE) ? IS_ID : 0;
goto parse_ident_slow;
}
}