GENH = errout.h \
idfsize.h numsize.h strsize.h target_sizes.h bigparam.h bigresult.h \
inputtype.h density.h squeeze.h nocross.h nostrict.h \
- def.h debugcst.h type.h Lpars.h node.h desig.h strict3rd.h real.h
+ def.h debugcst.h type.h Lpars.h node.h desig.h strict3rd.h real.h \
+ use_insert.h dbsymtab.h
HFILES =LLlex.h \
chk_expr.h class.h const.h debug.h f_info.h idf.h \
input.h main.h misc.h scope.h standards.h tokenname.h \
walk.o: strict3rd.h
walk.o: target_sizes.h
walk.o: type.h
+walk.o: use_insert.h
walk.o: walk.h
walk.o: warning.h
desig.o: LLlex.h
#include "misc.h"
#include "warning.h"
#include "bigresult.h"
+#include "use_insert.h"
extern arith NewPtr();
extern arith NewInt();
arith StackAdjustment = 0; /* space for conformant arrays */
arith retsav = 0; /* temporary space for return value */
arith func_res_size = 0;
+#ifdef USE_INSERT
int partno = C_getid();
int partno2 = C_getid();
- int end_reached; /* can fall through ... */
+#else
+ label cd_init;
+ label cd_body;
+#endif
proclevel++;
CurrVis = procedure->prc_vis;
/* Generate code for this procedure
*/
TmpOpen(procscope);
+#ifdef USE_INSERT
C_insertpart(partno2); /* procedure header */
+#else
+ C_pro_narg(procscope->sc_name);
+#ifdef DBSYMTAB
+ if (options['g']) {
+ C_ms_std((char *) 0, N_LBRAC, proclevel);
+ }
+#endif /* DBSYMTAB */
+ C_ms_par(procedure->df_type->prc_nbpar
+#ifdef BIG_RESULT_ON_STACK
+ + (too_big ? func_res_size : 0)
+#endif
+ );
+#endif
/* generate code for filename only when the procedure can be
exported, either directly or by taking the address.
This cannot be done if the level is bigger than one (because in
DoFilename(procscope->sc_level == 1);
DoPriority();
- C_insertpart(partno);
-
text_label = 1; /* label at end of procedure */
- end_reached = WalkNode(procedure->prc_body, NO_EXIT_LABEL, REACH_FLAG);
+#ifdef USE_INSERT
+ C_insertpart(partno);
+#else
+ cd_init = ++text_label;
+ cd_body = ++text_label;
+ C_bra(cd_init);
+ def_ilb(cd_body);
+#endif
+
+ if ((WalkNode(procedure->prc_body, NO_EXIT_LABEL, REACH_FLAG) & REACH_FLAG)) {
+ if (func_res_size) {
+ node_warning(procscope->sc_end,
+ W_ORDINARY,
+ "function procedure \"%s\" does not always return a value",
+ procedure->df_idf->id_text);
+ c_loc(M2_NORESULT);
+ C_trp();
+ C_asp(-func_res_size);
+ }
+#ifndef USE_INSERT
+ C_bra(RETURN_LABEL);
+#endif
+ }
+#ifdef USE_INSERT
C_beginpart(partno);
+#else
+ def_ilb(cd_init);
+#endif
/* Generate calls to initialization routines of modules defined within
this procedure
}
}
}
+#ifdef USE_INSERT
C_endpart(partno);
+#else
+ C_bra(cd_body);
+#endif
DO_DEBUG(options['X'], PrNode(procedure->prc_body, 0));
- if ((end_reached & REACH_FLAG) && func_res_size) {
- node_warning(procscope->sc_end,
- W_ORDINARY,
- "function procedure \"%s\" does not always return a value",
- procedure->df_idf->id_text);
- c_loc(M2_NORESULT);
- C_trp();
- C_asp(-func_res_size);
- }
def_ilb(RETURN_LABEL); /* label at end */
if (too_big) {
/* Fill the data area reserved for the function result
}
EndPriority();
C_ret(func_res_size);
+#ifdef USE_INSERT
C_beginpart(partno2);
C_pro(procscope->sc_name, -procscope->sc_off);
#ifdef DBSYMTAB
+ (too_big ? func_res_size : 0)
#endif
);
+#endif
if (! options['n']) WalkDefList(procscope->sc_def, RegisterMessage);
+#ifdef USE_INSERT
C_endpart(partno2);
+#endif
#ifdef DBSYMTAB
if (options['g']) {
C_ms_std((char *) 0, N_RBRAC, proclevel);