1 /* T E M P O R A R Y V A R I A B L E S */
3 /* Code for the allocation and de-allocation of temporary variables,
5 The routines use "ProcScope" instead of "CurrentScope", because
6 "CurrentScope" also reflects WITH statements, and these scopes do not
24 arith t_offset; /* offset from LocalBase */
27 /* ALLOCDEF "tmpvar" 10 */
29 static struct tmpvar *TmpInts, /* for integer temporaries */
30 *TmpPtrs; /* for pointer temporaries */
31 static struct scope *ProcScope; /* scope of procedure in which the
32 temporaries are allocated
38 /* Initialize for temporaries in scope "sc".
47 register struct scope *sc = ProcScope;
49 sc->sc_off = - WA(align(sz - sc->sc_off, al));
54 NewTmp(plist, sz, al, regtype, priority)
55 struct tmpvar **plist;
58 register arith offset;
59 register struct tmpvar *tmp;
62 offset = TmpSpace(sz, al);
63 if( !options['n'] ) C_ms_reg(offset, sz, regtype, priority);
67 offset = tmp->t_offset;
77 return NewTmp(&TmpInts, int_size, int_align, reg_any, reg_prior);
83 return NewTmp(&TmpPtrs, pointer_size, pointer_align, reg_pointer, reg_prior);
88 struct tmpvar **plist;
91 register struct tmpvar *tmp = new_tmpvar();
101 FreeTmp(&TmpInts, off);
107 FreeTmp(&TmpPtrs, off);
112 register struct tmpvar *tmp, *tmp1;
126 TmpInts = TmpPtrs = 0;