diff options
Diffstat (limited to 'src/linker/Linker/XmlDependencyRecorder.cs')
-rw-r--r-- | src/linker/Linker/XmlDependencyRecorder.cs | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/src/linker/Linker/XmlDependencyRecorder.cs b/src/linker/Linker/XmlDependencyRecorder.cs index 637b94c2a..8f093a29c 100644 --- a/src/linker/Linker/XmlDependencyRecorder.cs +++ b/src/linker/Linker/XmlDependencyRecorder.cs @@ -89,23 +89,27 @@ namespace Mono.Linker stream = null; } + public void RecordDependency (object target, in DependencyInfo reason, bool marked) + { + // For now, just report a dependency from source to target without noting the DependencyKind. + RecordDependency (reason.Source, target, marked); + } + public void RecordDependency (object source, object target, bool marked) { if (!ShouldRecord (source) && !ShouldRecord (target)) return; - // This is a hack to work around a quirk of MarkStep that results in outputting ~6k edges even with the above ShouldRecord checks. - // What happens is that due to the method queueing in MarkStep, the dependency chain is broken in many cases. And in these cases - // we end up adding an edge for MarkStep -> <queued Method> - // This isn't particularly useful information since it's incomplete, but it's especially not useful in ReducedTracing mode when there is one of these for - // every class library method that was queued. - if (context.EnableReducedTracing && source is MarkStep && !ShouldRecord (target)) + // We use a few hacks to work around MarkStep outputting thousands of edges even + // with the above ShouldRecord checks. Ideally we would format these into a meaningful format + // however I don't think that is worth the effort at the moment. + + // Prevent useless logging of attributes like `e="Other:Mono.Cecil.CustomAttribute"`. + if (source is CustomAttribute || target is CustomAttribute) return; - // This is another hack to prevent useless information from being logged. With the introduction of interface sweeping there are a lot of edges such as - // `e="InterfaceImpl:Mono.Cecil.InterfaceImplementation"` which are useless information. Ideally we would format the interface implementation into a meaningful format - // however I don't think that is worth the effort at the moment. - if (target is InterfaceImplementation) + // Prevent useless logging of interface implementations like `e="InterfaceImpl:Mono.Cecil.InterfaceImplementation"`. + if (source is InterfaceImplementation || target is InterfaceImplementation) return; if (source != target) { |