aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbellard <bellard>2002-11-22 13:37:52 +0000
committerbellard <bellard>2002-11-22 13:37:52 +0000
commit63965fc585a3149c0488a13ecfcc0d1aa9317bb7 (patch)
treed40c6a478bc8a5c5a2256bb31b05ea93e7561561
parent5286d3d84c83e966e0e0c6e059c0533fc8c76b44 (diff)
downloadtinycc-63965fc585a3149c0488a13ecfcc0d1aa9317bb7.tar.gz
tinycc-63965fc585a3149c0488a13ecfcc0d1aa9317bb7.tar.bz2
further parse optimizations
-rw-r--r--tcc.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/tcc.c b/tcc.c
index 2807c02..a4a5abb 100644
--- a/tcc.c
+++ b/tcc.c
@@ -2675,14 +2675,21 @@ static inline void next_nomacro1(void)
char *q;
TokenSym *ts;
- /* skip spaces */
- while(1) {
- while (ch == '\n') {
- /* during preprocessor parsing, '\n' is a token */
- if (return_linefeed) {
- tok = TOK_LINEFEED;
- return;
- }
+ redo_no_start:
+ switch(ch) {
+ case ' ':
+ case '\t':
+ case '\f':
+ case '\v':
+ case '\r':
+ cinp();
+ goto redo_no_start;
+
+ case '\n':
+ if (return_linefeed) {
+ /* XXX: should eat token ? */
+ tok = TOK_LINEFEED;
+ } else {
cinp();
skip_spaces();
if (ch == '#') {
@@ -2690,12 +2697,9 @@ static inline void next_nomacro1(void)
spaces */
preprocess();
}
+ goto redo_no_start;
}
- if (!is_space(ch))
- break;
- cinp();
- }
- switch(ch) {
+ break;
case '#':
tok = ch;