Commit Graph

2 Commits

Author SHA1 Message Date
Zoltan Somogyi
713d541ada Small improvements in the code simplifying calls.
compiler/const_prop.m:
    Replace pairs and maybes with a semantically meaningful type.
    Restrict this type to the part we actually use.

    Optimize ubits_per_{int,uint} the same way we have long optimized
    bits_per_{int,uint}.

compiler/simplify_goal_call.m:
    Improve the wording of some warnings.

    When constructing those warnings, don't test the value of warn_simple_code
    twice.

compiler/uint_emu.m:
    Fix copy-and-paste typo.

tests/warnings/unsigned_zero_cmp.exp:
    Expect the updated text of the above warnings.
2023-04-17 17:35:25 +10:00
Julien Fischer
e70a5406ad Warn about unsigned comparisons against zero that are tautologies etc.
If --warn-simple-code is enabled, then emit a warning for comparisons of
unsigned integer values against zero if that comparison is a tautology or
contradiction.

compiler/simplify_goal_call.m:
   Implement the new warning.

tests/warnings/Mmakefile:
tests/warnings/unsigned_zero_cmp.{m,exp}:
   Add a test of the new warning.
2018-10-21 03:22:18 +00:00