In fact I use the same mecanism as the Framework Emit library (as a design choice), so that when a branch-to-label is created, the user code has only to give a Label object, and not the instruction to jump to. This instruction is computed just before the code is emitted into the assembly via Cecil. At the moment I have modified the Cecil code to provide the FinalCreate to outside in order to do the job : cilWorker.FinalCreate(opcode, label) where label is a Label class that encapsulate a Instruction instance.
My first try was to pseudo-emit instructions into an own buffer that I manage internally, but I wanted to avoid the **possibly** huge work to reparse the instructions and call finally a "true" Cecil-compatible: cilWorker.Emit(opcode, labelInstruction) where labelInstructionis a Instruction instance. But if you say that the second solution if better, I'll do it! ;-)) Regis On 13 fév, 17:51, "Jb Evain" <[EMAIL PROTECTED]> wrote: > Could you detail your use case. With a little bit of code possibly, > because I don't quite see what you're doing with FinalCreate that you > can not do with the normal Create. And if you're doing something that > is not supported, it would feel better to add support for that instead > of simply exposing internal details. > > -- > Jb Evain <[EMAIL PROTECTED]> --~--~---------~--~----~------------~-------~--~----~ -- mono-cecil -~----------~----~----~----~------~----~------~--~---
