ref: 290af5c176be42347969ad80ed9d73391a36c61e
parent: a5d8b5e2cffc5f45bd195ff367997348379709a8
author: Ori Bernstein <[email protected]>
date: Fri Jun 22 09:37:44 EDT 2012
Don't try to generate code for templates.
--- a/8/asm.h
+++ b/8/asm.h
@@ -1,4 +1,6 @@
+/* x86 sure likes 4 */
#define Maxarg 4
+#define Wordsz 4
#define K 4 /* 4 general purpose regs with all modes available */
typedef size_t regid;
--- a/8/reduce.c
+++ b/8/reduce.c
@@ -691,7 +691,7 @@
case Oasn:
t = lval(s, args[0]);
u = rval(s, args[1]);
- if (size(n) > 4) {
+ if (size(n) > Wordsz) {
t = addr(t, exprtype(n));
u = addr(u, exprtype(n));
v = word(n->line, size(n));
@@ -701,7 +701,7 @@
}
break;
case Ocall:
- if (exprtype(n)->type != Tyvoid && size(n) > 4) {
+ if (exprtype(n)->type != Tyvoid && size(n) > Wordsz) {
r = temp(s, n);
linsert(&n->expr.args, &n->expr.nargs, 1, addr(r, exprtype(n)));
for (i = 0; i < n->expr.nargs; i++)
@@ -801,7 +801,7 @@
assert(f->type == Nfunc);
ty = f->func.type->sub[0];
- if (ty->type != Tyvoid && tysize(ty) > 4) {
+ if (ty->type != Tyvoid && tysize(ty) > Wordsz) {
s->isbigret = 1;
s->ret = gentemp(s, f, mktyptr(f->line, ty), &dcl);
declarearg(s, dcl);
@@ -931,7 +931,7 @@
tyvoid = mkty(-1, Tyvoid);
one = word(-1, 1);
zero = word(-1, 0);
- ptrsz = word(-1, 4);
+ ptrsz = word(-1, Wordsz);
fn = NULL;
nfn = 0;