diff options
author | David Wrighton <davidwr@microsoft.com> | 2017-11-08 05:19:24 +0300 |
---|---|---|
committer | David Wrighton <davidwr@microsoft.com> | 2017-11-08 05:19:24 +0300 |
commit | a0495d135109f4f6b60df64883fd1dffa747ae31 (patch) | |
tree | 4d55abbb3e618bebd2a3845a360e7448fe110b53 | |
parent | 7de9c242381df28c455a90dfc8d183aacf5530aa (diff) |
Consider types marked as having strong metadata mappings as rooted
[tfs-changeset: 1680506]
-rw-r--r-- | src/ILCompiler.Compiler/src/Compiler/PrecomputedMetadataManager.cs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/ILCompiler.Compiler/src/Compiler/PrecomputedMetadataManager.cs b/src/ILCompiler.Compiler/src/Compiler/PrecomputedMetadataManager.cs index f21cedb90..2191198f0 100644 --- a/src/ILCompiler.Compiler/src/Compiler/PrecomputedMetadataManager.cs +++ b/src/ILCompiler.Compiler/src/Compiler/PrecomputedMetadataManager.cs @@ -435,6 +435,12 @@ namespace ILCompiler { MetadataLoadedInfo loadedMetadata = _loadedMetadata.Value; + // Add all non-generic reflectable types as roots. + foreach (var type in loadedMetadata.TypesWithStrongMetadataMappings) + { + rootProvider.AddCompilationRoot(type, "Required non-generic type"); + } + // Add all non-generic reflectable methods as roots. // Virtual methods need special handling (e.g. with dependency tracking) since they can be abstract. foreach (var method in loadedMetadata.MethodMappings.Keys) |