language-cil icon indicating copy to clipboard operation
language-cil copied to clipboard

Short branches

Open dmcclean opened this issue 14 years ago • 2 comments

Should I add cases to OpCode for the short flavor of every branch? They all seem to have one,

Beq_s Label
Bge_s Label
Br_s Label
Leave_s Label
-- etc

It seems a bit pointless since they all take a label as an argument, the same as the long branches, and there is the added problem that the IL generated if anyone explicitly uses them could easily be wrong.

On the other hand (and I think more importantly), adding them is consistent with the decision to have both Ldc_i4 and Ldc_i4_s. It also is better for parsing and (especially) disassembly.

dmcclean avatar Feb 23 '11 23:02 dmcclean

I think it's best if the AST matches the CIL opcodes as closely as possible. As you say, this will make disassembly easier. So I'm in favour of adding them.

I'll try to get to the other issues you opened, asap. I've been very busy lately.

tomlokhorst avatar Feb 23 '11 23:02 tomlokhorst

Take your time. I'm getting changes together for a bunch of the other things. I'm working on the stack shape analysis right now, so that will keep me busy for a while.

dmcclean avatar Feb 23 '11 23:02 dmcclean