#ifndef STB
#include "label.h"
#include "stack.h"
+#include "Lpars.h"
extern arith NewLocal();
-#define LocalPtrVar() NewLocal(pointer_size, pointer_align, reg_pointer, 0)
+#define LocalPtrVar() NewLocal(pointer_size, pointer_align, reg_pointer, REGISTER)
#endif STB
/* Because EM does not support the loading and storing of
char *symbol2str();
char *long2str();
arith NewLocal(); /* util.c */
-#define LocalPtrVar() NewLocal(pointer_size, pointer_align, reg_pointer, 0)
+#define LocalPtrVar() NewLocal(pointer_size, pointer_align, reg_pointer, REGISTER)
/* EVAL() is the main expression-tree evaluator, which turns
any legal expression tree into EM code. Parameters:
NewLocal(type->tp_size,
type->tp_align,
regtype(type),
- (sc == REGISTER) ? REG_BONUS
- : REG_DEFAULT
- );
+ sc);
break;
case STATIC:
newdef->df_address = (arith) data_label();
def->df_level = L_FORMAL2; /* CJ */
RegisterAccount(def->df_address, def->df_type->tp_size,
regtype(def->df_type),
- (def->df_sc == REGISTER ? REG_BONUS
- : REG_DEFAULT)
- );
+ def->df_sc);
}
*fp = f_offset;
}
{
switch(tp->tp_fund) {
case INT:
+ case LONG:
return reg_any;
#ifndef NOFLOAT
case FLOAT:
#include "sizes.h"
#include "align.h"
#include "stack.h"
+#include "Lpars.h"
+#include "def.h"
static struct localvar *FreeTmps;
#ifdef USE_TMP
static struct localvar *regs[TABSIZ];
arith
-NewLocal(sz, al, regtype, init)
+NewLocal(sz, al, regtype, sc)
arith sz;
{
register struct localvar *tmp = FreeTmps;
while (tmp) {
if (tmp->t_align >= al &&
tmp->t_size >= sz &&
+ tmp->t_sc == sc &&
tmp->t_regtype == regtype) {
if (prev) {
prev->next = tmp->next;
tmp->t_offset = LocalSpace(sz, al);
tmp->t_align = al;
tmp->t_size = sz;
+ tmp->t_sc = sc;
tmp->t_regtype = regtype;
- tmp->t_count = init;
+ tmp->t_count = REG_DEFAULT;
}
index = (int) (tmp->t_offset >> 2) & (TABSIZ - 1);
tmp->next = regs[index];
tmp = FreeTmps;
while (tmp) {
tmp1 = tmp;
+ if (tmp->t_sc == REGISTER) tmp->t_count += REG_BONUS;
if (! options['n'] && tmp->t_regtype >= 0) {
C_ms_reg(tmp->t_offset, tmp->t_size, tmp->t_regtype, tmp->t_count);
}
for (i = 0; i < TABSIZ; i++) {
tmp = regs[i];
while (tmp) {
+ if (tmp->t_sc == REGISTER) tmp->t_count += REG_BONUS;
tmp1 = tmp;
if (! options['n'] && tmp->t_regtype >= 0) {
C_ms_reg(tmp->t_offset,
#endif
}
-RegisterAccount(offset, size, regtype, init)
+RegisterAccount(offset, size, regtype, sc)
arith offset, size;
{
register struct localvar *p;
index = (int) (offset >> 2) & (TABSIZ - 1);
p->t_offset = offset;
p->t_regtype = regtype;
- p->t_count = init;
+ p->t_count = REG_DEFAULT;
+ p->t_sc = sc;
p->t_size = size;
p->next = regs[index];
regs[index] = p;