Exemple #1
0
        internal static T Compile <T>(Type type, ILProgram program) where T : ILStruct, new()
        {
            var source = new T
            {
                Type    = type,
                Program = program
            };

            source.Compile();

            return(source);
        }
Exemple #2
0
        internal static T Compile <T>(MethodInfo info, ILProgram program) where T : ILSource, new()
        {
            var source = new T
            {
                Info    = info,
                Program = program
            };

            source.Compile();

            var kernel = info.GetCustomAttribute <KernelAttribute>();

            if (kernel != null)
            {
                source.IsKernel = true;
            }

            return(source);
        }