scc

Simple C99 Compiler
Log | Files | Refs | README | LICENSE

commit c40ce09e945f1f7fae5347518f85796fb038d053
parent b1235747c1c0b59be05f56a068a2d0f912b10227
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Fri, 20 Mar 2015 16:52:46 -0400

Change allocreg to receive only a num

These function only returns the number of the register which
is ready to be used, so it is a non sense to pass it the
pointer to the node.

Diffstat:
cc2/cgen.c | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/cc2/cgen.c b/cc2/cgen.c @@ -82,13 +82,13 @@ Node regs[] = { }; static uint8_t -allocreg(Node *np) +allocreg(uint8_t size) { static uint8_t reg8[] = {A, B, C, D, E, H, L, IYL, IY, 0}; static uint8_t reg16[] = {BC, DE, IY, 0}; uint8_t *bp, c; - switch (np->type.size) { + switch (size) { case 1: bp = reg8; break; @@ -128,7 +128,7 @@ spill(uint8_t reg) np->op = sym->kind; sym->dirty = 0; } else { - new = allocreg(np); + new = allocreg(1); moveto(np, new); } break;