[hackers] [scc] [cc2] Break dependency between O and S codes || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Sun, 24 Apr 2016 17:29:38 +0200 (CEST)

commit 1361aa0b0a2a65bc002d6d6625416162fec0d3fd
Author: Roberto E. Vargas Caballero <Roberto E. Vargas Caballero>
AuthorDate: Sat Apr 23 17:25:30 2016 +0200
Commit: Roberto E. Vargas Caballero <Roberto E. Vargas Caballero>
CommitDate: Sat Apr 23 17:25:30 2016 +0200

    [cc2] Break dependency between O and S codes
    
    Until now, codes like OAUTO were forced to be equal to codes like SAUTO.
    This commit break this dependency.

diff --git a/cc2/code.c b/cc2/code.c
index 1d0e4f4..a2b5b34 100644
--- a/cc2/code.c
+++ b/cc2/code.c
_AT_@ -29,16 +29,25 @@ nextpc(void)
 static void
 addr(Node *np, Addr *addr)
 {
- switch (addr->kind = np->op) {
- case SREG:
+ switch (np->op) {
+ case OREG:
+ addr->kind = SREG;
                 addr->u.reg = np->u.reg;
                 break;
- case SCONST:
+ case OCONST:
+ addr->kind = OCONST;
                 addr->u.i = np->u.i;
                 break;
- case SLABEL:
- case SAUTO:
- case STMP:
+ case OJMP:
+ case OLABEL:
+ addr->kind = SLABEL;
+ goto symbol;
+ case OAUTO:
+ addr->kind = SAUTO;
+ goto symbol;
+ case OTMP:
+ addr->kind = STMP;;
+ symbol:
                 addr->u.sym = np->u.sym;
                 break;
         default:
Received on Sun Apr 24 2016 - 17:29:38 CEST

This archive was generated by hypermail 2.3.0 : Sun Apr 24 2016 - 17:36:24 CEST