{
register t_type *tp = nd->nd_type;
+ DoLineno(nd);
if (tp->tp_fund == T_REAL) fp_used = 1;
switch(nd->nd_class) {
case Def:
C_zge(lb);
c_loc(ECONV);
C_trp();
- C_df_ilb(lb);
+ def_ilb(lb);
}
c_loc((int)(t1->tp_size));
c_loc((int)(t2->tp_size));
}
else C_lfr(sz);
}
+ DoFilename();
}
CodeParameters(param, arg)
C_zge(lb);
c_loc(ECONV);
C_trp();
- C_df_ilb(lb);
+ def_ilb(lb);
}
}
-Operands(leftop, rightop)
- register t_node *leftop, *rightop;
+Operands(nd)
+ register t_node *nd;
{
- CodePExpr(leftop);
- CodePExpr(rightop);
+ CodePExpr(nd->nd_left);
+ CodePExpr(nd->nd_right);
+ DoLineno(nd);
}
CodeOper(expr, true_label, false_label)
switch (expr->nd_symb) {
case '+':
- Operands(leftop, rightop);
+ Operands(expr);
switch (tp->tp_fund) {
case T_INTEGER:
C_adi(tp->tp_size);
}
break;
case '-':
- Operands(leftop, rightop);
+ Operands(expr);
switch (tp->tp_fund) {
case T_INTEGER:
C_sbi(tp->tp_size);
}
break;
case '*':
- Operands(leftop, rightop);
+ Operands(expr);
switch (tp->tp_fund) {
case T_INTEGER:
C_mli(tp->tp_size);
}
break;
case '/':
- Operands(leftop, rightop);
+ Operands(expr);
switch (tp->tp_fund) {
case T_REAL:
C_dvf(tp->tp_size);
}
break;
case DIV:
- Operands(leftop, rightop);
+ Operands(expr);
switch(tp->tp_fund) {
case T_INTEGER:
C_dvi(tp->tp_size);
}
break;
case MOD:
- Operands(leftop, rightop);
+ Operands(expr);
switch(tp->tp_fund) {
case T_INTEGER:
C_rmi(tp->tp_size);
case GREATEREQUAL:
case '=':
case '#':
- Operands(leftop, rightop);
+ Operands(expr);
tp = BaseType(leftop->nd_type);
if (tp == intorcard_type) tp = BaseType(rightop->nd_type);
switch (tp->tp_fund) {
CodeExpr(leftop, Des, true_label, l_maybe);
}
else CodeExpr(leftop, Des, l_maybe, false_label);
- C_df_ilb(l_maybe);
+ def_ilb(l_maybe);
free_desig(Des);
Des = new_desig();
CodeExpr(rightop, Des, true_label, false_label);
if (genlabels) {
- C_df_ilb(true_label);
+ def_ilb(true_label);
c_loc(1);
C_bra(l_end);
- C_df_ilb(false_label);
+ def_ilb(false_label);
c_loc(0);
- C_df_ilb(l_end);
+ def_ilb(l_end);
}
free_desig(Des);
break;
C_loc(eltype->sub_ub);
}
else C_loc((arith) (eltype->enm_ncst - 1));
- Operands(nd->nd_left, nd->nd_right);
+ Operands(nd);
C_cal("_LtoUset"); /* library routine to fill set */
C_asp(5 * word_size);
}
static t_type *func_type;
static arith priority;
+static int oldlineno;
static int RegisterMessage();
static int WalkDef();
enclosing LOOP.
*/
- C_df_ilb(lbl);
+ def_ilb(lbl);
WalkNode(nd, exit);
}
}
}
-STATIC
-DoProfil()
+def_ilb(l)
+ label l;
+{
+ C_df_ilb(l);
+ oldlineno = 0;
+}
+
+DoLineno(nd)
+ register t_node *nd;
+{
+ if (! options['L'] && nd->nd_lineno && nd->nd_lineno != oldlineno) {
+ oldlineno = nd->nd_lineno;
+ C_lin((arith) nd->nd_lineno);
+ }
+}
+
+DoFilename()
{
static label filename_label = 0;
TmpOpen(sc); /* Initialize for temporaries */
C_pro_narg(sc->sc_name);
DoPriority();
- DoProfil();
+ DoFilename();
if (module == Defined) {
/* Body of implementation or program module.
Call initialization routines of imported modules.
proclevel++;
WalkNode(module->mod_body, NO_EXIT_LABEL);
DO_DEBUG(options['X'], PrNode(module->mod_body, 0));
- C_df_ilb(RETURN_LABEL);
+ def_ilb(RETURN_LABEL);
EndPriority();
C_ret((arith) 0);
C_end(-sc->sc_off);
*/
C_pro_narg(sc->sc_name);
DoPriority();
- DoProfil();
+ DoFilename();
TmpOpen(sc);
func_type = tp = RemoveEqual(ResultType(procedure->df_type));
C_trp();
C_asp(-func_res_size);
}
- C_df_ilb(RETURN_LABEL); /* label at end */
+ def_ilb(RETURN_LABEL); /* label at end */
if (func_res_label) {
/* Fill the data area reserved for the function result
with the result
assert(nd->nd_class == Stat);
- if (! options['L'] && nd->nd_lineno) C_lin((arith) nd->nd_lineno);
+ DoLineno(nd);
switch(nd->nd_symb) {
case '(':
if (ChkCall(nd)) {
LblWalkNode(l1, right->nd_right, exit_label);
l1 = l2;
}
- C_df_ilb(l1);
+ def_ilb(l1);
break;
}
exit = ++text_label,
dummy = ++text_label;
- C_df_ilb(loop);
+ def_ilb(loop);
ExpectBool(left, dummy, exit);
LblWalkNode(dummy, right, exit_label);
C_bra(loop);
- C_df_ilb(exit);
+ def_ilb(exit);
break;
}
LblWalkNode(loop, left, exit_label);
ExpectBool(right, exit, loop);
- C_df_ilb(exit);
+ def_ilb(exit);
break;
}
LblWalkNode(loop, right, exit);
C_bra(loop);
- C_df_ilb(exit);
+ def_ilb(exit);
break;
}
}
C_stl(tmp);
nd->nd_def->df_flags |= D_FORLOOP;
- C_df_ilb(l1);
+ def_ilb(l1);
if (! options['R']) {
tmp2 = NewInt();
ForLoopVarExpr(nd);
C_beq(x);
c_loc(M2_FORCH);
C_trp();
- C_df_ilb(x);
+ def_ilb(x);
FreeInt(tmp2);
}
if (stepsize) {
}
}
C_bra(l1);
- C_df_ilb(l2);
+ def_ilb(l2);
FreeInt(tmp);
#ifdef DEBUG
nd->nd_left = left;