Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consistently report unresolved members in illink #103667

Merged
merged 2 commits into from
Jun 19, 2024
Merged
Changes from 1 commit
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)
sbomer marked this conversation as resolved.
Show resolved Hide resolved
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
Loading