コード例 #1
0
ファイル: 020-Types.cs プロジェクト: BickhamM21/Radon-Unity-
        public static void CheckStructWithPack()
        {
            var assemblyLoader = new AssemblyLoader();

            assemblyLoader.AddSearchDirectory(Path.GetDirectoryName(typeof(Types).Assembly.Location));
            var ilCompiler = new ILCompiler(new ExtendedCompilerBackend(new NopCompilerBackend()));

            // Check exception for fixed size layout
            {
                var structType = assemblyLoader.Resolve(typeof(StructWithPack));
                var ex         = Assert.Throws <CompilerException>(() => ilCompiler.CompileType(structType));
                StringAssert.Contains("The packing size `8` of the struct", ex.Message);
            }
        }
コード例 #2
0
ファイル: CompilerProcess.cs プロジェクト: kztao/FlingOS
 /// <summary>
 /// Initialises the ILCompiler.
 /// </summary>
 /// <returns>True if initialisation completed successfully. Otherwise false.</returns>
 private static bool InitILCompiler()
 {
     bool OK = false;
     try
     {
         TheILCompiler = new ILCompiler(TheSettings);
         OK = true;
     }
     catch (Exception ex)
     {
         if (ExecutingUnderMSBuild)
         {
             MSBuild_OutputError(ex);
         }
         else
         {
             OutputError(ex);
         }
         OK = false;
     }
     return OK;
 }
コード例 #3
0
ファイル: ILSource.cs プロジェクト: Wincent01/Compute
 protected override void Compile()
 {
     Source = ILCompiler.Compile(Info, this);
 }