Mosa.Compiler.Framework.Stages.TypeInitializerSchedulerStage.TypeInitializerSchedulerStage C# (CSharp) Method

TypeInitializerSchedulerStage() public method

Initializes a new instance of the TypeInitializerSchedulerStage class.
public TypeInitializerSchedulerStage ( ) : Mosa.Compiler.Framework.IR
return Mosa.Compiler.Framework.IR
        public TypeInitializerSchedulerStage()
        {
            basicBlocks = new BasicBlocks();

            // Create the blocks
            var prologueBlock = basicBlocks.CreateBlock(BasicBlock.PrologueLabel);
            var startBlock = basicBlocks.CreateBlock(BasicBlock.StartLabel);
            var epilogueBlock = basicBlocks.CreateBlock(BasicBlock.EpilogueLabel);

            // Create the prologue instructions
            basicBlocks.AddHeadBlock(prologueBlock);
            var prologue = new Context(prologueBlock);
            prologue.AppendInstruction(IRInstruction.Prologue);
            prologue.Label = -1;
            prologue.AppendInstruction(IRInstruction.Jmp, startBlock);

            // Create the epilogue instruction
            var epilogue = new Context(epilogueBlock);
            epilogue.AppendInstruction(IRInstruction.Epilogue);

            // create start instructions
            start = new Context(startBlock);
            start.AppendInstruction(IRInstruction.Jmp, epilogueBlock);
            start.GotoPrevious();
        }