示例#1
0
 /// <summary>
 /// Performs stage specific processing on the compiler context.
 /// </summary>
 /// <param name="compiler">The compiler context to perform processing in.</param>
 public void Run(AssemblyCompiler compiler)
 {
     if (this.implementation != null)
     {
         implementation.Run(compiler);
     }
 }
示例#2
0
        /// <summary>
        /// Performs stage specific processing on the compiler context.
        /// </summary>
        /// <param name="compiler">The compiler context to perform processing in.</param>
        public void Run(AssemblyCompiler compiler)
        {
            CheckImplementation();

            // Set the default entry point in the linker, if no previous stage has replaced it.
            RuntimeMethod entryPoint = compiler.Assembly.EntryPoint;

            if (this.implementation.EntryPoint == null && entryPoint != null)
            {
                this.implementation.EntryPoint = GetSymbol(entryPoint);
            }

            // Run the real linker
            IAssemblyCompilerStage acs = this.implementation as IAssemblyCompilerStage;

            Debug.Assert(acs != null, @"Linker doesn't implement IAssemblyCompilerStage.");
            if (acs != null)
            {
                acs.Run(compiler);
            }
        }
        /// <summary>
        /// Performs stage specific processing on the compiler context.
        /// </summary>
        void IAssemblyCompilerStage.Run()
        {
            CheckImplementation();

            ITypeModule mainModule = typeSystem.MainTypeModule;

            if (mainModule.MetadataModule.EntryPoint.RID != 0)
            {
                RuntimeMethod entrypoint = mainModule.GetMethod(mainModule.MetadataModule.EntryPoint);

                implementation.EntryPoint = GetSymbol(entrypoint.ToString());
            }

            // Run the real linker
            IAssemblyCompilerStage assemblyCompilerStage = implementation as IAssemblyCompilerStage;

            Debug.Assert(assemblyCompilerStage != null, @"Linker doesn't implement IAssemblyCompilerStage.");
            if (assemblyCompilerStage != null)
            {
                assemblyCompilerStage.Run();
            }
        }