diff options
| author | Michael Matz <matz@suse.de> | 2017-04-15 20:05:39 +0200 |
|---|---|---|
| committer | Michael Matz <matz@suse.de> | 2017-05-02 03:14:05 +0200 |
| commit | 9839b601773fecd1145b817f61980978c4af35e8 (patch) | |
| tree | 02b782e66a97e1e115198225cf92ae12641fe93a | |
| parent | c7dbc900c8089ddff753ca2d618fb313b357d927 (diff) | |
| download | tinycc-9839b601773fecd1145b817f61980978c4af35e8.tar.gz tinycc-9839b601773fecd1145b817f61980978c4af35e8.tar.bz2 | |
Remove label_or_decl
The only use of this function can be rewritten in terms of
is_label (if one other use of that one are a bit amended).
| -rw-r--r-- | tccgen.c | 26 |
1 files changed, 5 insertions, 21 deletions
@@ -5350,7 +5350,6 @@ static int is_label(void) last_tok = tok; next(); if (tok == ':') { - next(); return last_tok; } else { unget_tok(last_tok); @@ -5358,25 +5357,6 @@ static int is_label(void) } } -static void label_or_decl(int l) -{ - int last_tok; - - /* fast test first */ - if (tok >= TOK_UIDENT) - { - /* no need to save tokc because tok is an identifier */ - last_tok = tok; - next(); - if (tok == ':') { - unget_tok(last_tok); - return; - } - unget_tok(last_tok); - } - decl(l); -} - #ifndef TCC_TARGET_ARM64 static void gfunc_return(CType *func_type) { @@ -5601,7 +5581,10 @@ static void block(int *bsym, int *csym, int is_expr) } } while (tok != '}') { - label_or_decl(VT_LOCAL); + if ((a = is_label())) + unget_tok(a); + else + decl(VT_LOCAL); if (tok != '}') { if (is_expr) vpop(); @@ -5826,6 +5809,7 @@ static void block(int *bsym, int *csym, int is_expr) b = is_label(); if (b) { /* label case */ + next(); s = label_find(b); if (s) { if (s->r == LABEL_DEFINED) |
