Skip to content

Commit

Permalink
Address remaining Ref.Emit ILLink warnings in Mono. (#45723)
Browse files Browse the repository at this point in the history
* Address remaining Ref.Emit ILLink warnings in Mono.

Contributes to #45623

* Remove mono suppressions file from illink-sharedframework.targets
  • Loading branch information
eerhardt authored Dec 8, 2020
1 parent 66a1f97 commit 1f114c4
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 20 deletions.
1 change: 0 additions & 1 deletion src/libraries/illink-sharedframework.targets
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@
<!-- Collate CoreLib suppression XML files not bin-placed in earlier per-library linker run. CoreLib doesn't use bin-place logic. -->
<_SuppressionsXmls Include="$(CoreLibSharedILLinkSuppressionsFilesPrefix).xml" />
<_SuppressionsXmls Condition="'$(TargetOS)' != 'windows'" Include="$(CoreLibSharedILLinkSuppressionsFilesPrefix).NonWindows.xml" />
<_SuppressionsXmls Condition="'$(RuntimeFlavor)' == 'Mono'" Include="$(MonoProjectRoot)netcore\System.Private.CoreLib\$(ProjectILLinkSuppressionsFile).xml" />

<!-- netstandard2.1-only System.ComponentModel.Annotations XML file is not bin-placed during -allConfigurations builds
due to the linker not being run on the assembly (eng\illink.targets). Manually include it. -->
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ private static MethodInfo ExtractBaseMethod(MethodInfo info)
}

// Called from the runtime to return the corresponding finished MethodInfo object
[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2060:MakeGenericMethod",
Justification = "MethodOnTypeBuilderInst is Reflection.Emit's underlying implementation of MakeGenericMethod. " +
"Callers of the outer calls to MakeGenericMethod will be warned as appropriate.")]
internal MethodInfo RuntimeResolve()
{
Type type = instantiation.InternalResolve();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -910,6 +910,8 @@ private bool has_ctor_method()
return this;
}

[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2074:UnrecognizedReflectionPattern",
Justification = "Linker doesn't analyze ResolveUserType but it's an identity function")]
private void ResolveUserTypes()
{
parent = ResolveUserType(parent);
Expand Down Expand Up @@ -1054,7 +1056,7 @@ public override Type GetElementType()
/* Needed to keep signature compatibility with MS.NET */
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicEvents)]
[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2085:UnrecognizedReflectionPattern",
Justification = "Linker doesn't recongnize GetEvents(BindingFlags.Public) but this is what the body is doing")]
Justification = "Linker doesn't recognize GetEvents(BindingFlags.Public) but this is what the body is doing")]
public override EventInfo[] GetEvents()
{
const BindingFlags DefaultBindingFlags = BindingFlags.Public | BindingFlags.Static | BindingFlags.Instance;
Expand Down Expand Up @@ -1615,7 +1617,7 @@ public FieldBuilder DefineUninitializedData(string name, int size, FieldAttribut
public override int MetadataToken => 0x02000000 | table_idx;

[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2074:UnrecognizedReflectionPattern",
Justification = "Linker doesn't recongnize ResolveUserType")]
Justification = "Linker doesn't analyze ResolveUserType but it's an identity function")]
public void SetParent([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type? parent)
{
check_not_created();
Expand Down

0 comments on commit 1f114c4

Please sign in to comment.