Skip to content

Commit

Permalink
Expose Resolve helper for assemblies (dotnet/linker#2074)
Browse files Browse the repository at this point in the history
* Implement IAssemblyResolver for LinkContext

Fixes dotnet/linker#2073

* Fix using order

* Don't implement IAssemblyResolver

Commit migrated from dotnet/linker@802aa45
  • Loading branch information
sbomer authored Jun 8, 2021
1 parent ecfe1d3 commit 4e7c449
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/tools/illink/src/linker/Linker/LinkContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,11 @@ public AssemblyDefinition Resolve (IMetadataScope scope)
return _resolver.Resolve (reference);
}

public AssemblyDefinition Resolve (AssemblyNameReference name)
{
return _resolver.Resolve (name);
}

public void RegisterAssembly (AssemblyDefinition assembly)
{
if (SeenFirstTime (assembly)) {
Expand Down
2 changes: 2 additions & 0 deletions src/tools/illink/src/linker/ref/Linker/LinkContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,7 @@ internal LinkContext () { }
public MethodDefinition TryResolve (MethodReference methodReference) { throw null; }
public FieldDefinition TryResolve (FieldReference fieldReference) { throw null; }
public TypeDefinition TryResolve (TypeReference typeReference) { throw null; }

public AssemblyDefinition Resolve (AssemblyNameReference nameReference) { throw null; }
}
}

0 comments on commit 4e7c449

Please sign in to comment.