Inheritance: IMethodCollector, IMethodCollectorResults
コード例 #1
0
        private void Apply()
        {
            InflatedCollectionCollector collector;

            TypeDefinition[] definitionArray;
            using (TinyProfiler.Section("PreProcessStage", ""))
            {
                this.PreProcessStage(out collector, out definitionArray);
            }
            MethodCollector     methodCollector     = new MethodCollector();
            AttributeCollection attributeCollection = new AttributeCollection();
            MetadataCollector   metadataCollection  = new MetadataCollector();

            using (TinyProfiler.Section("MetadataCollector", ""))
            {
                metadataCollection.AddAssemblies(this._assembliesOrderedByDependency);
            }
            using (TinyProfiler.Section("AllAssemblyConversion", ""))
            {
                foreach (AssemblyDefinition definition in this._assembliesOrderedByDependency)
                {
                    using (TinyProfiler.Section("Convert", definition.Name.Name))
                    {
                        this.Convert(definition, collector, attributeCollection, methodCollector, metadataCollection);
                    }
                }
            }
            methodCollector.Complete();
            using (TinyProfiler.Section("WriteGenerics", ""))
            {
                this.WriteGenerics(collector.AsReadOnly(), definitionArray, metadataCollection);
            }
            using (TinyProfiler.Section("VariousInvokers", ""))
            {
                this._virtualInvokerCollector.Write(this.GetPathFor("GeneratedVirtualInvokers", "h"));
                this._genericVirtualInvokerCollector.Write(this.GetPathFor("GeneratedGenericVirtualInvokers", "h"));
                this._interfaceInvokerCollector.Write(this.GetPathFor("GeneratedInterfaceInvokers", "h"));
                this._genericInterfaceInvokerCollector.Write(this.GetPathFor("GeneratedGenericInterfaceInvokers", "h"));
            }
            using (TinyProfiler.Section("Metadata", "Global"))
            {
                SourceWriter.WriteCollectedMetadata(collector, this._assembliesOrderedByDependency, this._outputDir, this._dataFolder, metadataCollection, attributeCollection, this._vTableBuilder, methodCollector);
            }
            using (TinyProfiler.Section("Copy Etc", ""))
            {
                if (CodeGenOptions.Dotnetprofile == DotNetProfile.Net45)
                {
                    MonoInstall.BleedingEdge.ConfigPath.Copy(this._dataFolder);
                }
                else
                {
                    MonoInstall.TwoSix.ConfigPath.Copy(this._dataFolder);
                }
            }
            this._debuggerSupport.GenerateSupportFilesIfNeeded(this._outputDir);
        }
コード例 #2
0
        public void Write(AssemblyDefinition assemblyDefinition, InflatedCollectionCollector allGenerics, NPath outputDir, TypeDefinition[] typeList, AttributeCollection attributeCollection, MethodCollector methodCollector, IMetadataCollection metadataCollection)
        {
            string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(assemblyDefinition.MainModule.FullyQualifiedName);

            using (TinyProfiler.Section("Code", ""))
            {
                if (< > f__am$cache0 == null)
                {