These two methods help me a lot while dealing with blocks of instructions. I deal with some functions that has a lot of switch cases so I build them bottom-up, the first method Insert(instr) inserts an instruction at the top of the method body, and the second Insert(instr[]) inserts a block of instructions at the top of method body and returns the reference to the first instruction of the block (which becomes the first of the method body anyway). If this is useful for someone else, feel free to use. I would also for sake of curiosity ask how is your approach for generating code that needs to jump ahead (like a switch block), do you build from bottom-up or there is another interesting technique?
PS: This applies to SVN rev 125068. Augusto --~--~---------~--~----~------------~-------~--~----~ -- mono-cecil -~----------~----~----~----~------~----~------~--~---
cecil-cil-patch.diff
Description: Binary data
