What is the feature or code improvement you would like to do in Cranelift?
I would like Switch to have a new method entries() added which returns an immutable list of the existing entries.
What is the value of adding this in Cranelift?
This would allow me to check in the codegen module whether a case expression has already been added, instead of having to frontload it in the parser (which for various reasons would be possible but annoying).
Do you have an implementation plan, and/or ideas for data structures or
algorithms to use?
I would like
Switch
to have a new methodentries()
added which returns an immutable list of the existing entries.This would allow me to check in the codegen module whether a
case
expression has already been added, instead of having to frontload it in the parser (which for various reasons would be possible but annoying).Alternatively, Cranelift could
impl Deref<Target = HashMap<...>>
for Switch. This would also provide more methods at the same time.Cranelift could also choose to do nothing at all.