reorganisation of lint code

This commit is contained in:
dick
1988-09-25 17:29:37 +00:00
parent fb854c82ff
commit 3d549e7932
8 changed files with 296 additions and 239 deletions

View File

@@ -144,22 +144,22 @@ if_statement
/* The comparison has been optimized
to a 0 or 1.
*/
#ifdef LINT
hwarning("condition in if is constant");
#endif LINT
if (expr->VL_VALUE == (arith)0) {
C_bra(l_false);
}
/* else fall through */
#ifdef LINT
start_if_part(1);
#endif LINT
}
else {
code_expr(expr, RVAL, TRUE, l_true, l_false);
C_df_ilb(l_true);
#ifdef LINT
start_if_part(0);
#endif LINT
}
free_expression(expr);
#ifdef LINT
start_if_part();
#endif LINT
}
')'
statement
@@ -363,13 +363,7 @@ switch_statement
{
code_startswitch(&expr);
#ifdef LINT
start_switch_part();
/* the following is a trick to detect a constant
* expression in a switch
*/
opnd2test(&expr, SWITCH);
if (is_cp_cst(expr))
hwarning("switch value is constant");
start_switch_part(expr);
#endif LINT
}
')'