Esempio n. 1
0
        public override void LoadReferences(ModuleContainer module)
        {
            List <Tuple <RootNamespace, Assembly> > loaded;

            base.LoadReferencesCore(module, out corlib, out loaded);

            compiler.TimeReporter.Start(TimeReporter.TimerType.ReferencesImporting);

            if (corlib == null)
            {
                // System.Object was not found in any referenced assembly, use compiled assembly as corlib
                corlib = module.DeclaringAssembly.Builder;
            }
            else
            {
                importer.InitializeBuiltinTypes(compiler.BuiltinTypes, corlib);
                importer.ImportAssembly(corlib, module.GlobalRootNamespace);
            }

            foreach (var entry in loaded)
            {
                importer.ImportAssembly(entry.Item2, entry.Item1);
            }

            compiler.TimeReporter.Stop(TimeReporter.TimerType.ReferencesImporting);
        }
Esempio n. 2
0
        public override void LoadReferences(ModuleContainer module)
        {
            List <Tuple <RootNamespace, Assembly> > loaded;

            base.LoadReferencesCore(module, out corlib, out loaded);

            if (corlib != null)
            {
                importer.InitializeBuildinTypes(compiler.BuildinTypes, corlib);
                importer.ImportAssembly(corlib, module.GlobalRootNamespace);
            }

            foreach (var entry in loaded)
            {
                importer.ImportAssembly(entry.Item2, entry.Item1);
            }
        }