2 static char rcsid[] = "$Id: reg.c,v 2.9 1994/06/24 10:40:55 ceriel Exp $";
18 * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
19 * See the copyright notice in the ACK home directory, in the file "Copyright".
21 * Author: Hans van Staveren
24 regvar(ap) register arg_p ap; {
30 while (ap!=(arg_p)0 && ap->a_typ==ARGOFF && i<4) {
31 rp->r_par[i++]=ap->a_a.a_offset;
35 * Omit incomplete messages
38 default:assert(FALSE);
41 case 2: oldreg(rp); return;
42 case 3: rp->r_par[3]= (offset) 0; break;
45 rp->r_next = curpro.freg;
49 inreg(off) offset off; {
52 for (rp=curpro.freg; rp != (reg_p) 0; rp=rp->r_next)
53 if( rp->r_par[0] == off)
62 for(rp=curpro.freg; rp != (reg_p) 0; rp = tp) {
65 outoff((offset)ms_reg);
71 /* List of register messages is followed by an empty ms_reg
72 * unless an ms_gto was in this procedure, then the ms_gto
73 * will be output. Kludgy.
76 outoff((offset)(curpro.gtoproc? ms_gto : ms_reg));
78 curpro.freg = (reg_p) 0;
81 /* outtes() handles the output of the top elt. messages */
83 register num_p *npp, np;
85 for (npp=curpro.numhash;npp< &curpro.numhash[NNUMHASH]; npp++) {
86 for (np = *npp; np != (num_p) 0; np=np->n_next) {
87 if (! (np->n_flags & NUMSET) || np->n_size == 0 ||
88 (np->n_flags & NUMCOND)) continue;
90 outoff((offset)ms_tes);
91 outoff((offset)np->n_number);
92 outoff((offset)np->n_size);
93 outoff((offset)((np->n_flags & NUMFALLTHROUGH) ? 1 : 0));
99 incregusage(off) offset off; {
103 /* If we're optimizing the output of the global optimizer
104 * we must not change the count fields of the register messages.
106 for(rp=curpro.freg; rp != (reg_p) 0; rp=rp->r_next)
107 if (rp->r_par[0]==off) {