scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

commit c1e0104d5d49ab4d4f6545f90fb4c14cb76cd7b8
parent de14dcda8c70cba2b4833cb4ede3269156e9d754
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Thu, 26 May 2016 15:06:17 +0200

[cc2] Update the number of cases per switch

This is a very important field because it will determinate
which of the possible implementation will be used for the
switch.

Diffstat:
Mcc2/parser.c | 7+++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/cc2/parser.c b/cc2/parser.c @@ -337,15 +337,18 @@ static void waft(Node *np) { Node *p; + struct swtch *cur; if (swp == swtbl) error(EWTACKU); - p = swp[-1].last; + cur = swp - 1; + p = cur->last; np->next = p->next; np->prev = p; p->next = np; - swp[-1].last = np; + cur->last = np; + cur->nr++; } static void