Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions src/tools/illink/src/linker/Linker/LinkContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -802,8 +802,11 @@ public int GetTargetRuntimeVersion ()
if (methodReference is null)
return null;

if (methodresolveCache.TryGetValue (methodReference, out MethodDefinition? md))
if (methodresolveCache.TryGetValue (methodReference, out MethodDefinition? md)) {
if (md == null && !IgnoreUnresolved)
ReportUnresolved (methodReference);
return md;
}

#pragma warning disable RS0030 // Cecil's resolve is banned -- this provides the wrapper
md = methodReference.Resolve ();
Expand Down Expand Up @@ -847,8 +850,11 @@ public int GetTargetRuntimeVersion ()
if (fieldReference is null)
return null;

if (fieldresolveCache.TryGetValue (fieldReference, out FieldDefinition? fd))
if (fieldresolveCache.TryGetValue (fieldReference, out FieldDefinition? fd)) {
if (fd == null && !IgnoreUnresolved)
ReportUnresolved (fieldReference);
return fd;
}

fd = fieldReference.Resolve ();
if (fd == null && !IgnoreUnresolved)
Expand Down Expand Up @@ -888,8 +894,11 @@ public int GetTargetRuntimeVersion ()
if (typeReference is null)
return null;

if (typeresolveCache.TryGetValue (typeReference, out TypeDefinition? td))
if (typeresolveCache.TryGetValue (typeReference, out TypeDefinition? td)) {
if (td == null && !IgnoreUnresolved)
ReportUnresolved (typeReference);
return td;
}

//
// Types which never have TypeDefinition or can have ambiguous definition should not be passed in
Expand Down