3989ee1b9667f2b3f02c36066ee1d9c2b9bfbb05
* Copyright (c) 1980 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
static char sccsid
[] = "@(#)fdec.c 5.1 (Berkeley) %G%";
* this array keeps the pxp counters associated with
* functions and procedures, so that they can be output
* when their bodies are encountered
* save the counter for this function
fp
-> value
[ NL_CNTR
] = bodycnts
[ cbn
];
* Funcext marks the procedure or
* function external in the symbol
* table. Funcext should only be
* called if PC, and is an error
error("Procedures or functions cannot be declared external.");
* save the counter for this function
fp
-> value
[ NL_CNTR
] = bodycnts
[ cbn
];
error("External procedures and functions are not standard");
fp
->extra_flags
|= NEXTERN
;
stabefunc( fp
-> symbol
, fp
-> class , line
);
error("External procedures and functions can only be declared at the outermost level.");
* when the actual (resolved)
* declaration of a procedure is
* encountered. It puts the names
* of the (function) and parameters
error("Too many levels of function/procedure nesting");
for (q
= fp
->chain
; q
!= NIL
; q
= q
->chain
) {
q
-> extra_flags
|= NPARAM
;
* For functions, enter the fvar
(void) enter(fp
->ptr
[NL_FVAR
]);
q
= fp
-> ptr
[ NL_FVAR
];
sizes
[cbn
].curtmps
.om_off
= q
-> value
[NL_OFFS
];
sizes
[cbn
].om_max
= q
-> value
[NL_OFFS
];
* pick up the pointer to porf declaration
PorFHeader
[ ++nesting
] = fp
-> inTree
;
* Segend is called to check for
* unresolved variables, funcs and
* procs, and deliver unresolved and
* baduse error diagnostics at the
* end of a routine segment (a separately
* compiled segment that is not the
* main program) for PC. This
* routine should only be called
error("Only the module containing the \"program\" statement");
cerror("can be profiled with ``pxp''.\n");
error("Separately compiled routine segments are not standard.");
for (p
= disptab
[i
]; p
!= NIL
&& (p
->nl_block
& 037) == b
; p
= p
->nl_next
) {
if (((struct udinfo
*) (p
->chain
))->ud_next
== NIL
)
if (p
->value
[NL_KINDS
] & ISUNDEF
)
nerror("%s undefined on line%s", p
->symbol
, cp
);
nerror("%s improperly used on line%s", p
->symbol
, cp
);
pnums((struct udinfo
*) (p
->chain
));
if ((p
->nl_flags
& NFORWD
) &&
((p
->extra_flags
& NEXTERN
) == 0))
nerror("Unresolved forward declaration of %s %s", classes
[p
->class], p
->symbol
);
if (((p
->nl_flags
& NMOD
) == 0) &&
((p
->chain
->extra_flags
& NEXTERN
) == 0))
nerror("No assignment to the function variable");
error("Missing program statement and program body");
* Level1 does level one processing for
* separately compiled routine segments
error("Missing program statement");
error("Missing program statement");
printf(" %d", p
->ud_line
);
printf("In %s %s:\n", classes
[Fp
->class], Fp
->symbol
);