Open femtomc opened 4 years ago
Ah! You must use blocks
instead of fieldname indexing with .blocks
to get a Block
- I didn't realize that.
Yup – Block
is the public interface to all block operations, whereas BasicBlock
is just the internal representation. Perhaps we need to be clear in the docs that internal fields are off-limits.
Not sure if this is intended but https://github.com/MikeInnes/IRTools.jl/blob/bacecb8a71eb0026963021d33e4ba16bfc7211da/src/ir/ir.jl#L630 doesn't work on BBs, as illustrated:
which throws
because there's no inheritance https://github.com/MikeInnes/IRTools.jl/blob/bacecb8a71eb0026963021d33e4ba16bfc7211da/src/ir/ir.jl#L129-L134
It looks like it's easy to implement this i.e. in the
/src
forpush!
:I think this issue is about a more general confusion of the difference between
Block
andBasicBlock
(i.e. the documentation uses block to possibly refer to both?)