diff options
author | Mike Voorhees <mrvoorhe@users.noreply.github.com> | 2017-04-27 17:52:05 +0300 |
---|---|---|
committer | Marek Safar <marek.safar@gmail.com> | 2017-04-27 17:52:05 +0300 |
commit | 9a8e477f918f30382027f862d45f05697d1ccea6 (patch) | |
tree | 3fb56de6893461f9fe3f9dcc17ca490275bb04da /linker | |
parent | 501558b7988ddcac37b8f10c4fb90217f59417a5 (diff) |
Linker resolver interface (#43)
* Change CacheAssembly to return the assembly
* Make CacheAssembly virtual
* Fix LinkContext.Resolve not returning the same
assembly on subsequent calls
Diffstat (limited to 'linker')
-rw-r--r-- | linker/Mono.Linker/AssemblyResolver.cs | 3 | ||||
-rw-r--r-- | linker/Mono.Linker/LinkContext.cs | 3 |
2 files changed, 3 insertions, 3 deletions
diff --git a/linker/Mono.Linker/AssemblyResolver.cs b/linker/Mono.Linker/AssemblyResolver.cs index 169d06f98..6313d53c2 100644 --- a/linker/Mono.Linker/AssemblyResolver.cs +++ b/linker/Mono.Linker/AssemblyResolver.cs @@ -66,10 +66,11 @@ namespace Mono.Linker { return asm; } - public void CacheAssembly (AssemblyDefinition assembly) + public virtual AssemblyDefinition CacheAssembly (AssemblyDefinition assembly) { _assemblies [assembly.Name.Name] = assembly; base.AddSearchDirectory (Path.GetDirectoryName (assembly.MainModule.FileName)); + return assembly; } protected override void Dispose (bool disposing) diff --git a/linker/Mono.Linker/LinkContext.cs b/linker/Mono.Linker/LinkContext.cs index c0c0b6200..681608a3a 100644 --- a/linker/Mono.Linker/LinkContext.cs +++ b/linker/Mono.Linker/LinkContext.cs @@ -160,8 +160,7 @@ namespace Mono.Linker { { if (File.Exists (name)) { AssemblyDefinition assembly = AssemblyDefinition.ReadAssembly (name, _readerParameters); - _resolver.CacheAssembly (assembly); - return assembly; + return _resolver.CacheAssembly (assembly); } return Resolve (new AssemblyNameReference (name, new Version ())); |