File: makefram.c

package info (click to toggle)
icmake 6.30-3
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 2,360 kB
  • ctags: 1,415
  • sloc: ansic: 7,727; makefile: 1,465; sh: 244; asm: 126; cpp: 39
file content (41 lines) | stat: -rw-r--r-- 1,364 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
                                M A K E F R A M . C
*/

#include "iccomp.h"

void make_frame()
{
    register unsigned
        fun_index,
        index;
    ESTRUC_
        e;

    if (!(fun_index = funtab.n_defined))
        return;

    fun_index--;

                                            /* set offset of 1st byte */
    funtab.symbol[fun_index].var.vu.i->count =
                                        (unsigned)ftell(s_bin);

                                            /* room for type-bytes */
    funtab.symbol[fun_index].var.vu.i->ls.list.element =
                        xrealloc(NULL, n_params * sizeof(char));
                                            /* store # of params */
    funtab.symbol[fun_index].var.vu.i->ls.list.size = n_params;
                                            /* assign parameter types to str */
    for (index = 0; index < n_params; index++)
        ((char *)funtab.symbol[fun_index].var.vu.i->ls.list.element)[index] =
                     (char)(local.symbol[index].var.type & ALLTYPES);

    if (local.n_defined - n_params)         /* any local variables ? */
    {
        e = stackframe(0);                  /* initialize empty frame */
        gencode(&e, op_frame);              /* generate frame instruction */
        outbin(e.code, e.codelen);          /* write to s_bin */
        free(e.code);
    }
}