jibby/utils/incdec

Codegen helpers for optimizing increment and decrement operations.

Nim's inc operator gets compiled into something += (NI) 1. To SDCC, this will be pretty much just something++ for value-types or something already in the register, but for indirect variables, this will result in a lot more code.

For these use cases, we will have to emit some C manually. These macros override the declarations in system, so it is just drop-in.

Macros

macro dec(variable: var SomeInteger): untyped
macro inc(variable: var SomeInteger): untyped