tomlokhorst / language-cil

Manipulating Common Intermediate Language AST in Haskell
Other
20 stars 8 forks source link

Short branches #15

Open dmcclean opened 13 years ago

dmcclean commented 13 years ago

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.

tomlokhorst commented 13 years ago

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.

dmcclean commented 13 years ago

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.