Delete leftover reflection eventsource handling (#81686)
authorMichal Strehovský <MichalStrehovsky@users.noreply.github.com>
Mon, 6 Feb 2023 17:22:27 +0000 (02:22 +0900)
committerGitHub <noreply@github.com>
Mon, 6 Feb 2023 17:22:27 +0000 (09:22 -0800)
This is annotated in the CoreLib now.

src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/UsageBasedMetadataManager.cs

index efd659f..1209299 100644 (file)
@@ -350,29 +350,6 @@ namespace ILCompiler
                     }
                 }
             }
-
-            // Event sources need their special nested types
-            if (mdType != null && mdType.HasCustomAttribute("System.Diagnostics.Tracing", "EventSourceAttribute"))
-            {
-                AddEventSourceSpecialTypeDependencies(ref dependencies, factory, mdType.GetNestedType("Keywords"));
-                AddEventSourceSpecialTypeDependencies(ref dependencies, factory, mdType.GetNestedType("Tasks"));
-                AddEventSourceSpecialTypeDependencies(ref dependencies, factory, mdType.GetNestedType("Opcodes"));
-
-                static void AddEventSourceSpecialTypeDependencies(ref DependencyList dependencies, NodeFactory factory, MetadataType type)
-                {
-                    if (type != null)
-                    {
-                        const string reason = "Event source";
-                        dependencies ??= new DependencyList();
-                        dependencies.Add(factory.TypeMetadata(type), reason);
-                        foreach (FieldDesc field in type.GetFields())
-                        {
-                            if (field.IsLiteral)
-                                dependencies.Add(factory.FieldMetadata(field), reason);
-                        }
-                    }
-                }
-            }
         }
 
         private static bool IsTrimmableAssembly(ModuleDesc assembly)