pub struct Chrec {
pub base: Invariant,
pub step: Invariant,
pub ty: Type,
pub flags: Flags,
}Expand description
An affine chain of recurrences, {base, +, step}, evolving in a named type.
The type is not decoration. {0, +, 1} in unsigned char is not the sequence 0, 1, 2, ...,
it is that sequence modulo two hundred and fifty six, and section 7.7 says this is where a
naive implementation is wrong constantly and in ways that pass every test written by someone
thinking in int. Every operation here checks the type and every one that cannot stay right
in it answers unknown.
Fields§
§base: InvariantWhat the value is on the first iteration.
step: InvariantWhat is added each time round.
ty: TypeThe type it evolves in, which is what says when it wraps.
flags: FlagsWhat the instruction that increments it promised. nsw means the sequence does not wrap
when read as signed and nuw means it does not when read as unsigned, and both come from
the increment rather than from anything this analysis proved.