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

Schedule() public method

Schedules the specified method for invocation in the main.
public Schedule ( MosaMethod method ) : void
method MosaMethod The method.
return void
        public void Schedule(MosaMethod method)
        {
            var symbolOperand = Operand.CreateSymbolFromMethod(TypeSystem, method);
            start.AppendInstruction(IRInstruction.Call, null, symbolOperand);
            start.InvokeMethod = method;
        }

Usage Example

        /// <summary>
        /// Initializes the type.
        /// </summary>
        protected virtual void InitializeType()
        {
            if (Method.IsSpecialName && Method.IsRTSpecialName && Method.IsStatic && Method.Name == ".cctor")
            {
                typeInitializer = Compiler.PostCompilePipeline.FindFirst<TypeInitializerSchedulerStage>();

                if (typeInitializer == null)
                    return;

                typeInitializer.Schedule(Method);
            }
        }
All Usage Examples Of Mosa.Compiler.Framework.Stages.TypeInitializerSchedulerStage::Schedule