308 references to DynamicallyAccessedMemberTypes
ILLink.RoslynAnalyzer (308)
DataFlow\DynamicallyAccessedMembersBinder.cs (17)
17
public static IEnumerable<ISymbol> GetDynamicallyAccessedMembers (this ITypeSymbol typeDefinition,
DynamicallyAccessedMemberTypes
memberTypes, bool declaredOnly = false)
19
if (memberTypes ==
DynamicallyAccessedMemberTypes
.None)
22
if (memberTypes ==
DynamicallyAccessedMemberTypes
.All) {
32
if (memberTypes.HasFlag (
DynamicallyAccessedMemberTypes
.NonPublicConstructors)) {
38
if (memberTypes.HasFlag (
DynamicallyAccessedMemberTypes
.PublicConstructors)) {
44
if (memberTypes.HasFlag (
DynamicallyAccessedMemberTypes
.PublicParameterlessConstructor)) {
49
if (memberTypes.HasFlag (
DynamicallyAccessedMemberTypes
.NonPublicMethods)) {
55
if (memberTypes.HasFlag (
DynamicallyAccessedMemberTypes
.PublicMethods)) {
60
if (memberTypes.HasFlag (
DynamicallyAccessedMemberTypes
.NonPublicFields)) {
66
if (memberTypes.HasFlag (
DynamicallyAccessedMemberTypes
.PublicFields)) {
71
if (memberTypes.HasFlag (
DynamicallyAccessedMemberTypes
.NonPublicNestedTypes)) {
82
if (memberTypes.HasFlag (
DynamicallyAccessedMemberTypes
.PublicNestedTypes)) {
93
if (memberTypes.HasFlag (
DynamicallyAccessedMemberTypes
.NonPublicProperties)) {
99
if (memberTypes.HasFlag (
DynamicallyAccessedMemberTypes
.PublicProperties)) {
104
if (memberTypes.HasFlag (
DynamicallyAccessedMemberTypes
.NonPublicEvents)) {
110
if (memberTypes.HasFlag (
DynamicallyAccessedMemberTypes
.PublicEvents)) {
115
if (memberTypes.HasFlag (
DynamicallyAccessedMemberTypes
.Interfaces)) {
DynamicallyAccessedMembersAnalyzer.cs (25)
153
if (member is IFieldSymbol field && field.GetDynamicallyAccessedMemberTypes () !=
DynamicallyAccessedMemberTypes
.None && !field.Type.IsTypeInterestingForDataflow (isByRef: field.RefKind is not RefKind.None))
156
if (method.GetDynamicallyAccessedMemberTypesOnReturnType () !=
DynamicallyAccessedMemberTypes
.None && !method.ReturnType.IsTypeInterestingForDataflow (isByRef: method.ReturnsByRef))
158
if (method.GetDynamicallyAccessedMemberTypes () !=
DynamicallyAccessedMemberTypes
.None && !method.ContainingType.IsTypeInterestingForDataflow (isByRef: false))
161
if (parameter.GetDynamicallyAccessedMemberTypes () !=
DynamicallyAccessedMemberTypes
.None && !parameter.Type.IsTypeInterestingForDataflow (isByRef: parameter.RefKind is not RefKind.None))
164
} else if (member is IPropertySymbol property && property.GetDynamicallyAccessedMemberTypes () !=
DynamicallyAccessedMemberTypes
.None && !property.Type.IsTypeInterestingForDataflow (isByRef: property.ReturnsByRef)) {
179
var
overrideMethodReturnAnnotation = FlowAnnotations.GetMethodReturnValueAnnotation (overrideMethod);
180
var
baseMethodReturnAnnotation = FlowAnnotations.GetMethodReturnValueAnnotation (baseMethod);
183
(IMethodSymbol attributableMethod,
DynamicallyAccessedMemberTypes
missingAttribute) = GetTargetAndRequirements (overrideMethod,
202
var
baseParameterAnnotation = FlowAnnotations.GetMethodParameterAnnotation (baseParam);
203
var
overrideParameterAnnotation = FlowAnnotations.GetMethodParameterAnnotation (overrideParam);
205
(IMethodSymbol attributableMethod,
DynamicallyAccessedMemberTypes
missingAttribute) = GetTargetAndRequirements (overrideMethod,
225
var
methodTypeParameterAnnotation = overrideMethod.TypeParameters[i].GetDynamicallyAccessedMemberTypes ();
226
var
overriddenMethodTypeParameterAnnotation = baseMethod.TypeParameters[i].GetDynamicallyAccessedMemberTypes ();
229
(IMethodSymbol attributableMethod,
DynamicallyAccessedMemberTypes
missingAttribute) = GetTargetAndRequirements (overrideMethod, baseMethod, methodTypeParameterAnnotation, overriddenMethodTypeParameterAnnotation);
250
var
overrideMethodThisAnnotation = FlowAnnotations.GetMethodParameterAnnotation (new ParameterProxy (new (overrideMethod), (ParameterIndex) 0));
251
var
baseMethodThisAnnotation = FlowAnnotations.GetMethodParameterAnnotation (new ParameterProxy (new (baseMethod), (ParameterIndex) 0));
284
|| propertySymbol.GetDynamicallyAccessedMemberTypes () ==
DynamicallyAccessedMemberTypes
.None)
289
&& methodSymbol.GetDynamicallyAccessedMemberTypesOnReturnType () !=
DynamicallyAccessedMemberTypes
.None
292
&& methodSymbol.Parameters[methodSymbol.Parameters.Length - 1].GetDynamicallyAccessedMemberTypes () !=
DynamicallyAccessedMemberTypes
.None) {
303
private static (IMethodSymbol Method,
DynamicallyAccessedMemberTypes
Requirements) GetTargetAndRequirements (IMethodSymbol method, IMethodSymbol overriddenMethod,
DynamicallyAccessedMemberTypes
methodAnnotation,
DynamicallyAccessedMemberTypes
overriddenMethodAnnotation)
305
DynamicallyAccessedMemberTypes
mismatchedArgument;
307
if (methodAnnotation ==
DynamicallyAccessedMemberTypes
.None) {
317
private static (Location[]?, Dictionary<string, string?>?) CreateArguments (Location attributableSymbolLocation,
DynamicallyAccessedMemberTypes
mismatchedArgument)
DynamicallyAccessedMembersTypeHierarchy.cs (7)
17
var
annotation = FlowAnnotations.GetTypeAnnotation (type);
24
var
baseAnnotation = FlowAnnotations.GetTypeAnnotation (baseType);
25
var
annotationToApplyToBase = Annotations.GetMissingMemberTypes (annotation, baseAnnotation);
35
if (annotation.HasFlag (
DynamicallyAccessedMemberTypes
.Interfaces))
37
var
annotationToApplyToInterfaces = annotation ==
DynamicallyAccessedMemberTypes
.All ? annotation :
DynamicallyAccessedMemberTypes
.Interfaces;
ISymbolExtensions.cs (8)
56
internal static
DynamicallyAccessedMemberTypes
GetDynamicallyAccessedMemberTypes (this ISymbol symbol)
59
return
DynamicallyAccessedMemberTypes
.None;
61
return (
DynamicallyAccessedMemberTypes
) dynamicallyAccessedMembers!.ConstructorArguments[0].Value!;
64
internal static
DynamicallyAccessedMemberTypes
GetDynamicallyAccessedMemberTypesOnReturnType (this IMethodSymbol methodSymbol)
75
return
DynamicallyAccessedMemberTypes
.None;
77
return (
DynamicallyAccessedMemberTypes
) dynamicallyAccessedMembers.ConstructorArguments[0].Value!;
103
internal static
DynamicallyAccessedMemberTypes
GetDynamicallyAccessedMemberTypesOnAssociatedSymbol (this IMethodSymbol methodSymbol) =>
104
methodSymbol.AssociatedSymbol is ISymbol associatedSymbol ? GetDynamicallyAccessedMemberTypes (associatedSymbol) :
DynamicallyAccessedMemberTypes
.None;
src\tools\illink\src\ILLink.Shared\Annotations.cs (31)
19
DynamicallyAccessedMemberTypes
sourceMemberTypes,
20
DynamicallyAccessedMemberTypes
targetMemberTypes,
25
var
missingMemberTypes = GetMissingMemberTypes (targetMemberTypes, sourceMemberTypes);
26
if (missingMemberTypes ==
DynamicallyAccessedMemberTypes
.None)
33
public static
DynamicallyAccessedMemberTypes
GetMissingMemberTypes (
DynamicallyAccessedMemberTypes
requiredMemberTypes,
DynamicallyAccessedMemberTypes
availableMemberTypes)
36
return
DynamicallyAccessedMemberTypes
.None;
38
if (requiredMemberTypes ==
DynamicallyAccessedMemberTypes
.All)
39
return
DynamicallyAccessedMemberTypes
.All;
41
var
missingMemberTypes = requiredMemberTypes & ~availableMemberTypes;
45
if (requiredMemberTypes.HasFlag (
DynamicallyAccessedMemberTypes
.PublicConstructors) &&
46
!availableMemberTypes.HasFlag (
DynamicallyAccessedMemberTypes
.PublicConstructors))
47
missingMemberTypes |=
DynamicallyAccessedMemberTypes
.PublicConstructors;
52
public static string GetMemberTypesString (
DynamicallyAccessedMemberTypes
memberTypes)
54
Debug.Assert (memberTypes !=
DynamicallyAccessedMemberTypes
.None);
56
if (memberTypes ==
DynamicallyAccessedMemberTypes
.All)
57
return $"'{nameof (
DynamicallyAccessedMemberTypes
)}.{nameof (
DynamicallyAccessedMemberTypes
.All)}'";
60
.Where (damt => (memberTypes & damt) == damt && damt !=
DynamicallyAccessedMemberTypes
.None)
63
if (memberTypes.HasFlag (
DynamicallyAccessedMemberTypes
.PublicConstructors))
64
memberTypesList.Remove (
DynamicallyAccessedMemberTypes
.PublicParameterlessConstructor);
67
string mtName = mt ==
DynamicallyAccessedMemberTypes
.Interfaces
68
? nameof (
DynamicallyAccessedMemberTypes
.Interfaces)
71
return $"'{nameof (
DynamicallyAccessedMemberTypes
)}.{mtName}'";
75
private static readonly
DynamicallyAccessedMemberTypes
[] AllDynamicallyAccessedMemberTypes = GetAllDynamicallyAccessedMemberTypes ();
77
private static
DynamicallyAccessedMemberTypes
[] GetAllDynamicallyAccessedMemberTypes ()
79
var values = new HashSet<
DynamicallyAccessedMemberTypes
> (
80
Enum.GetValues (typeof (
DynamicallyAccessedMemberTypes
))
81
.Cast<
DynamicallyAccessedMemberTypes
> ());
82
values.Add (
DynamicallyAccessedMemberTypes
.Interfaces);
src\tools\illink\src\ILLink.Shared\DynamicallyAccessedMemberTypesEx.cs (24)
13
public const
DynamicallyAccessedMemberTypes
NonPublicConstructorsWithInherited =
DynamicallyAccessedMemberTypes
.NonPublicConstructors | (
DynamicallyAccessedMemberTypes
) 0x4000;
18
public const
DynamicallyAccessedMemberTypes
NonPublicMethodsWithInherited =
DynamicallyAccessedMemberTypes
.NonPublicMethods | (
DynamicallyAccessedMemberTypes
) 0x8000;
23
public const
DynamicallyAccessedMemberTypes
NonPublicFieldsWithInherited =
DynamicallyAccessedMemberTypes
.NonPublicFields | (
DynamicallyAccessedMemberTypes
) 0x10000;
28
public const
DynamicallyAccessedMemberTypes
NonPublicNestedTypesWithInherited =
DynamicallyAccessedMemberTypes
.NonPublicNestedTypes | (
DynamicallyAccessedMemberTypes
) 0x20000;
33
public const
DynamicallyAccessedMemberTypes
NonPublicPropertiesWithInherited =
DynamicallyAccessedMemberTypes
.NonPublicProperties | (
DynamicallyAccessedMemberTypes
) 0x40000;
38
public const
DynamicallyAccessedMemberTypes
NonPublicEventsWithInherited =
DynamicallyAccessedMemberTypes
.NonPublicEvents | (
DynamicallyAccessedMemberTypes
) 0x80000;
43
public const
DynamicallyAccessedMemberTypes
PublicConstructorsWithInherited =
DynamicallyAccessedMemberTypes
.PublicConstructors | (
DynamicallyAccessedMemberTypes
) 0x100000;
48
public const
DynamicallyAccessedMemberTypes
PublicNestedTypesWithInherited =
DynamicallyAccessedMemberTypes
.PublicNestedTypes | (
DynamicallyAccessedMemberTypes
) 0x200000;
src\tools\illink\src\ILLink.Shared\TrimAnalysis\FlowAnnotations.cs (4)
22
internal partial MethodReturnValue GetMethodReturnValue (MethodProxy method, bool isNewObj,
DynamicallyAccessedMemberTypes
dynamicallyAccessedMemberTypes);
28
internal partial GenericParameterValue GetGenericParameterValue (GenericParameterProxy genericParameter,
DynamicallyAccessedMemberTypes
dynamicallyAccessedMemberTypes);
30
internal partial MethodParameterValue GetMethodThisParameterValue (MethodProxy method,
DynamicallyAccessedMemberTypes
dynamicallyAccessedMemberTypes);
34
internal partial MethodParameterValue GetMethodParameterValue (ParameterProxy param,
DynamicallyAccessedMemberTypes
dynamicallyAccessedMemberTypes);
src\tools\illink\src\ILLink.Shared\TrimAnalysis\HandleCallAction.cs (140)
86
Debug.Assert (requiresDataFlowAnalysis || annotatedMethodReturnValue.DynamicallyAccessedMemberTypes ==
DynamicallyAccessedMemberTypes
.None);
223
var targetValue = _annotations.GetMethodThisParameterValue (calledMethod,
DynamicallyAccessedMemberTypes
.Interfaces);
239
DynamicallyAccessedMemberTypes
returnMemberTypes =
DynamicallyAccessedMemberTypes
.Interfaces;
243
&& valueWithDynamicallyAccessedMembers.DynamicallyAccessedMemberTypes ==
DynamicallyAccessedMemberTypes
.All)
244
returnMemberTypes =
DynamicallyAccessedMemberTypes
.All;
294
&& (damAnnotatedHandle.UnderlyingTypeValue.DynamicallyAccessedMemberTypes &
DynamicallyAccessedMemberTypes
.NonPublicConstructors) != 0) {
322
DynamicallyAccessedMemberTypes
memberTypes;
325
IntrinsicId.Type_GetConstructors__BindingFlags =>
DynamicallyAccessedMemberTypes
.PublicConstructors |
DynamicallyAccessedMemberTypes
.NonPublicConstructors,
326
IntrinsicId.Type_GetMethods__BindingFlags =>
DynamicallyAccessedMemberTypes
.PublicMethods |
DynamicallyAccessedMemberTypes
.NonPublicMethods,
327
IntrinsicId.Type_GetEvents__BindingFlags =>
DynamicallyAccessedMemberTypes
.PublicEvents |
DynamicallyAccessedMemberTypes
.NonPublicEvents,
328
IntrinsicId.Type_GetFields__BindingFlags =>
DynamicallyAccessedMemberTypes
.PublicFields |
DynamicallyAccessedMemberTypes
.NonPublicFields,
329
IntrinsicId.Type_GetProperties__BindingFlags =>
DynamicallyAccessedMemberTypes
.PublicProperties |
DynamicallyAccessedMemberTypes
.NonPublicProperties,
330
IntrinsicId.Type_GetNestedTypes__BindingFlags =>
DynamicallyAccessedMemberTypes
.PublicNestedTypes |
DynamicallyAccessedMemberTypes
.NonPublicNestedTypes,
331
IntrinsicId.Type_GetMembers__BindingFlags =>
DynamicallyAccessedMemberTypes
.PublicConstructors |
DynamicallyAccessedMemberTypes
.NonPublicConstructors |
332
DynamicallyAccessedMemberTypes
.PublicEvents |
DynamicallyAccessedMemberTypes
.NonPublicEvents |
333
DynamicallyAccessedMemberTypes
.PublicFields |
DynamicallyAccessedMemberTypes
.NonPublicFields |
334
DynamicallyAccessedMemberTypes
.PublicMethods |
DynamicallyAccessedMemberTypes
.NonPublicMethods |
335
DynamicallyAccessedMemberTypes
.PublicProperties |
DynamicallyAccessedMemberTypes
.NonPublicProperties |
336
DynamicallyAccessedMemberTypes
.PublicNestedTypes |
DynamicallyAccessedMemberTypes
.NonPublicNestedTypes,
385
DynamicallyAccessedMemberTypes
memberTypes = intrinsicId switch {
444
DynamicallyAccessedMemberTypes
requiredMemberTypes;
446
requiredMemberTypes =
DynamicallyAccessedMemberTypes
.PublicConstructors |
DynamicallyAccessedMemberTypes
.NonPublicConstructors |
447
DynamicallyAccessedMemberTypes
.PublicEvents |
DynamicallyAccessedMemberTypes
.NonPublicEvents |
448
DynamicallyAccessedMemberTypes
.PublicFields |
DynamicallyAccessedMemberTypes
.NonPublicFields |
449
DynamicallyAccessedMemberTypes
.PublicMethods |
DynamicallyAccessedMemberTypes
.NonPublicMethods |
450
DynamicallyAccessedMemberTypes
.PublicProperties |
DynamicallyAccessedMemberTypes
.NonPublicProperties |
451
DynamicallyAccessedMemberTypes
.PublicNestedTypes |
DynamicallyAccessedMemberTypes
.NonPublicNestedTypes;
533
const
DynamicallyAccessedMemberTypes
ImplicitNestedTypeAccessLevel =
535
DynamicallyAccessedMemberTypes
.PublicMethods | DynamicallyAccessedMemberTypesEx.NonPublicMethodsWithInherited |
536
DynamicallyAccessedMemberTypes
.PublicFields | DynamicallyAccessedMemberTypesEx.NonPublicFieldsWithInherited |
537
DynamicallyAccessedMemberTypes
.PublicProperties | DynamicallyAccessedMemberTypesEx.NonPublicPropertiesWithInherited |
538
DynamicallyAccessedMemberTypes
.PublicEvents | DynamicallyAccessedMemberTypesEx.NonPublicEventsWithInherited |
540
DynamicallyAccessedMemberTypes
.Interfaces;
580
if (value is ValueWithDynamicallyAccessedMembers { DynamicallyAccessedMemberTypes:
DynamicallyAccessedMemberTypes
.All })
581
AddReturnValue (_annotations.GetMethodReturnValue (calledMethod, _isNewObj,
DynamicallyAccessedMemberTypes
.All));
608
DynamicallyAccessedMemberTypes
requiredMemberTypes = intrinsicId switch {
609
IntrinsicId.RuntimeReflectionExtensions_GetRuntimeEvent =>
DynamicallyAccessedMemberTypes
.PublicEvents,
610
IntrinsicId.RuntimeReflectionExtensions_GetRuntimeField =>
DynamicallyAccessedMemberTypes
.PublicFields,
611
IntrinsicId.RuntimeReflectionExtensions_GetRuntimeMethod =>
DynamicallyAccessedMemberTypes
.PublicMethods,
612
IntrinsicId.RuntimeReflectionExtensions_GetRuntimeProperty =>
DynamicallyAccessedMemberTypes
.PublicProperties,
665
var targetValue = _annotations.GetMethodParameterValue (new (calledMethod, (ParameterIndex) 0),
DynamicallyAccessedMemberTypes
.PublicParameterlessConstructor);
701
_annotations.GetMethodParameterValue (new (calledMethod, (ParameterIndex) 1),
DynamicallyAccessedMemberTypes
.None).GetDiagnosticArgumentsForAnnotationMismatch ().ToArray ());
714
DynamicallyAccessedMemberTypes
memberTypes = intrinsicId == IntrinsicId.Expression_Property
715
?
DynamicallyAccessedMemberTypes
.PublicProperties |
DynamicallyAccessedMemberTypes
.NonPublicProperties
716
:
DynamicallyAccessedMemberTypes
.PublicFields |
DynamicallyAccessedMemberTypes
.NonPublicFields;
953
DynamicallyAccessedMemberTypes
propagatedMemberTypes =
DynamicallyAccessedMemberTypes
.None;
954
if (valueWithDynamicallyAccessedMembers.DynamicallyAccessedMemberTypes ==
DynamicallyAccessedMemberTypes
.All)
955
propagatedMemberTypes =
DynamicallyAccessedMemberTypes
.All;
965
if (valueWithDynamicallyAccessedMembers.DynamicallyAccessedMemberTypes.HasFlag (
DynamicallyAccessedMemberTypes
.PublicEvents))
966
propagatedMemberTypes |=
DynamicallyAccessedMemberTypes
.PublicEvents;
971
if (valueWithDynamicallyAccessedMembers.DynamicallyAccessedMemberTypes.HasFlag (
DynamicallyAccessedMemberTypes
.PublicFields))
972
propagatedMemberTypes |=
DynamicallyAccessedMemberTypes
.PublicFields;
977
if (valueWithDynamicallyAccessedMembers.DynamicallyAccessedMemberTypes.HasFlag (
DynamicallyAccessedMemberTypes
.PublicMethods))
978
propagatedMemberTypes |=
DynamicallyAccessedMemberTypes
.PublicMethods;
993
if (valueWithDynamicallyAccessedMembers.DynamicallyAccessedMemberTypes.HasFlag (
DynamicallyAccessedMemberTypes
.PublicProperties))
994
propagatedMemberTypes |=
DynamicallyAccessedMemberTypes
.PublicProperties;
999
if (valueWithDynamicallyAccessedMembers.DynamicallyAccessedMemberTypes.HasFlag (
DynamicallyAccessedMemberTypes
.Interfaces))
1000
propagatedMemberTypes |=
DynamicallyAccessedMemberTypes
.Interfaces;
1059
var
requiredMemberTypes = GetDynamicallyAccessedMemberTypesFromBindingFlagsForConstructors (bindingFlags);
1061
if (requiredMemberTypes ==
DynamicallyAccessedMemberTypes
.PublicConstructors && ctorParameterCount == 0)
1062
requiredMemberTypes =
DynamicallyAccessedMemberTypes
.PublicParameterlessConstructor;
1156
var
requiredMemberTypes = GetDynamicallyAccessedMemberTypesFromBindingFlagsForConstructors (bindingFlags);
1159
if (ctorParameterCount == 0 && requiredMemberTypes.HasFlag (
DynamicallyAccessedMemberTypes
.PublicConstructors)) {
1160
requiredMemberTypes &= ~
DynamicallyAccessedMemberTypes
.PublicConstructors;
1161
requiredMemberTypes |=
DynamicallyAccessedMemberTypes
.PublicParameterlessConstructor;
1284
if (GetGenericParameterEffectiveMemberTypes (genericParameter) !=
DynamicallyAccessedMemberTypes
.None) {
1330
static
DynamicallyAccessedMemberTypes
GetGenericParameterEffectiveMemberTypes (GenericParameterValue genericParameter)
1332
DynamicallyAccessedMemberTypes
result = genericParameter.DynamicallyAccessedMemberTypes;
1334
result |=
DynamicallyAccessedMemberTypes
.PublicParameterlessConstructor;
1444
internal static
DynamicallyAccessedMemberTypes
GetDynamicallyAccessedMemberTypesFromBindingFlagsForNestedTypes (BindingFlags? bindingFlags) =>
1445
(HasBindingFlag (bindingFlags, BindingFlags.Public) ?
DynamicallyAccessedMemberTypes
.PublicNestedTypes :
DynamicallyAccessedMemberTypes
.None) |
1446
(HasBindingFlag (bindingFlags, BindingFlags.NonPublic) ?
DynamicallyAccessedMemberTypes
.NonPublicNestedTypes :
DynamicallyAccessedMemberTypes
.None) |
1447
(BindingFlagsAreUnsupported (bindingFlags) ?
DynamicallyAccessedMemberTypes
.PublicNestedTypes |
DynamicallyAccessedMemberTypes
.NonPublicNestedTypes :
DynamicallyAccessedMemberTypes
.None);
1449
internal static
DynamicallyAccessedMemberTypes
GetDynamicallyAccessedMemberTypesFromBindingFlagsForConstructors (BindingFlags? bindingFlags) =>
1450
(HasBindingFlag (bindingFlags, BindingFlags.Public) ?
DynamicallyAccessedMemberTypes
.PublicConstructors :
DynamicallyAccessedMemberTypes
.None) |
1451
(HasBindingFlag (bindingFlags, BindingFlags.NonPublic) ?
DynamicallyAccessedMemberTypes
.NonPublicConstructors :
DynamicallyAccessedMemberTypes
.None) |
1452
(BindingFlagsAreUnsupported (bindingFlags) ?
DynamicallyAccessedMemberTypes
.PublicConstructors |
DynamicallyAccessedMemberTypes
.NonPublicConstructors :
DynamicallyAccessedMemberTypes
.None);
1454
internal static
DynamicallyAccessedMemberTypes
GetDynamicallyAccessedMemberTypesFromBindingFlagsForMethods (BindingFlags? bindingFlags) =>
1455
(HasBindingFlag (bindingFlags, BindingFlags.Public) ?
DynamicallyAccessedMemberTypes
.PublicMethods :
DynamicallyAccessedMemberTypes
.None) |
1456
(HasBindingFlag (bindingFlags, BindingFlags.NonPublic) ?
DynamicallyAccessedMemberTypes
.NonPublicMethods :
DynamicallyAccessedMemberTypes
.None) |
1457
(BindingFlagsAreUnsupported (bindingFlags) ?
DynamicallyAccessedMemberTypes
.PublicMethods |
DynamicallyAccessedMemberTypes
.NonPublicMethods :
DynamicallyAccessedMemberTypes
.None);
1459
internal static
DynamicallyAccessedMemberTypes
GetDynamicallyAccessedMemberTypesFromBindingFlagsForFields (BindingFlags? bindingFlags) =>
1460
(HasBindingFlag (bindingFlags, BindingFlags.Public) ?
DynamicallyAccessedMemberTypes
.PublicFields :
DynamicallyAccessedMemberTypes
.None) |
1461
(HasBindingFlag (bindingFlags, BindingFlags.NonPublic) ?
DynamicallyAccessedMemberTypes
.NonPublicFields :
DynamicallyAccessedMemberTypes
.None) |
1462
(BindingFlagsAreUnsupported (bindingFlags) ?
DynamicallyAccessedMemberTypes
.PublicFields |
DynamicallyAccessedMemberTypes
.NonPublicFields :
DynamicallyAccessedMemberTypes
.None);
1464
internal static
DynamicallyAccessedMemberTypes
GetDynamicallyAccessedMemberTypesFromBindingFlagsForProperties (BindingFlags? bindingFlags) =>
1465
(HasBindingFlag (bindingFlags, BindingFlags.Public) ?
DynamicallyAccessedMemberTypes
.PublicProperties :
DynamicallyAccessedMemberTypes
.None) |
1466
(HasBindingFlag (bindingFlags, BindingFlags.NonPublic) ?
DynamicallyAccessedMemberTypes
.NonPublicProperties :
DynamicallyAccessedMemberTypes
.None) |
1467
(BindingFlagsAreUnsupported (bindingFlags) ?
DynamicallyAccessedMemberTypes
.PublicProperties |
DynamicallyAccessedMemberTypes
.NonPublicProperties :
DynamicallyAccessedMemberTypes
.None);
1469
internal static
DynamicallyAccessedMemberTypes
GetDynamicallyAccessedMemberTypesFromBindingFlagsForEvents (BindingFlags? bindingFlags) =>
1470
(HasBindingFlag (bindingFlags, BindingFlags.Public) ?
DynamicallyAccessedMemberTypes
.PublicEvents :
DynamicallyAccessedMemberTypes
.None) |
1471
(HasBindingFlag (bindingFlags, BindingFlags.NonPublic) ?
DynamicallyAccessedMemberTypes
.NonPublicEvents :
DynamicallyAccessedMemberTypes
.None) |
1472
(BindingFlagsAreUnsupported (bindingFlags) ?
DynamicallyAccessedMemberTypes
.PublicEvents |
DynamicallyAccessedMemberTypes
.NonPublicEvents :
DynamicallyAccessedMemberTypes
.None);
1474
internal static
DynamicallyAccessedMemberTypes
GetDynamicallyAccessedMemberTypesFromBindingFlagsForMembers (BindingFlags? bindingFlags) =>
src\tools\illink\src\ILLink.Shared\TrimAnalysis\NullableValueWithDynamicallyAccessedMembers.cs (1)
31
public override
DynamicallyAccessedMemberTypes
DynamicallyAccessedMemberTypes => UnderlyingTypeValue.DynamicallyAccessedMemberTypes;
src\tools\illink\src\ILLink.Shared\TrimAnalysis\RequireDynamicallyAccessedMembersAction.cs (5)
23
if (targetValue.DynamicallyAccessedMemberTypes ==
DynamicallyAccessedMemberTypes
.None)
27
if (targetValue.DynamicallyAccessedMemberTypes ==
DynamicallyAccessedMemberTypes
.PublicParameterlessConstructor
31
} else if (targetValue.DynamicallyAccessedMemberTypes ==
DynamicallyAccessedMemberTypes
.PublicFields
39
var
availableMemberTypes = valueWithDynamicallyAccessedMembers.DynamicallyAccessedMemberTypes;
74
private partial void MarkTypeForDynamicallyAccessedMembers (in TypeProxy type,
DynamicallyAccessedMemberTypes
dynamicallyAccessedMemberTypes);
src\tools\illink\src\ILLink.Shared\TrimAnalysis\ValueWithDynamicallyAccessedMembers.cs (1)
15
public abstract
DynamicallyAccessedMemberTypes
DynamicallyAccessedMemberTypes { get; }
TrimAnalysis\FieldValue.cs (1)
23
public override
DynamicallyAccessedMemberTypes
DynamicallyAccessedMemberTypes { get; }
TrimAnalysis\FlowAnnotations.cs (26)
27
if (GetMethodReturnValueAnnotation (method) !=
DynamicallyAccessedMemberTypes
.None)
31
if (GetMethodParameterAnnotation (param) !=
DynamicallyAccessedMemberTypes
.None)
48
if (GetMethodReturnValueAnnotation (method) ==
DynamicallyAccessedMemberTypes
.None) {
98
if (GetMethodParameterAnnotation (param) !=
DynamicallyAccessedMemberTypes
.None)
107
return GetFieldAnnotation (field) !=
DynamicallyAccessedMemberTypes
.None;
110
internal static
DynamicallyAccessedMemberTypes
GetFieldAnnotation (IFieldSymbol field)
113
return
DynamicallyAccessedMemberTypes
.None;
118
internal static
DynamicallyAccessedMemberTypes
GetTypeAnnotations (INamedTypeSymbol type)
120
DynamicallyAccessedMemberTypes
typeAnnotation = type.GetDynamicallyAccessedMemberTypes ();
137
internal static
DynamicallyAccessedMemberTypes
GetMethodParameterAnnotation (ParameterProxy param)
141
return
DynamicallyAccessedMemberTypes
.None;
148
return
DynamicallyAccessedMemberTypes
.None;
150
var
damt = parameter.GetDynamicallyAccessedMemberTypes ();
160
&& damt ==
DynamicallyAccessedMemberTypes
.None
170
public static
DynamicallyAccessedMemberTypes
GetMethodReturnValueAnnotation (IMethodSymbol method)
173
return
DynamicallyAccessedMemberTypes
.None;
175
var
returnDamt = method.GetDynamicallyAccessedMemberTypesOnReturnType ();
180
if (method.MethodKind is MethodKind.PropertyGet && returnDamt ==
DynamicallyAccessedMemberTypes
.None) {
189
public static
DynamicallyAccessedMemberTypes
GetTypeAnnotation(ITypeSymbol type)
191
var
typeAnnotation = type.GetDynamicallyAccessedMemberTypes ();
214
internal partial MethodReturnValue GetMethodReturnValue (MethodProxy method, bool isNewObj,
DynamicallyAccessedMemberTypes
dynamicallyAccessedMemberTypes)
220
internal partial GenericParameterValue GetGenericParameterValue (GenericParameterProxy genericParameter,
DynamicallyAccessedMemberTypes
dynamicallyAccessedMemberTypes)
226
internal partial MethodParameterValue GetMethodThisParameterValue (MethodProxy method,
DynamicallyAccessedMemberTypes
dynamicallyAccessedMemberTypes)
238
var
damt = GetMethodParameterAnnotation (param);
242
internal MethodParameterValue GetMethodParameterValue (MethodProxy method, ParameterIndex parameterIndex,
DynamicallyAccessedMemberTypes
dynamicallyAccessedMemberTypes)
248
internal partial MethodParameterValue GetMethodParameterValue (ParameterProxy param,
DynamicallyAccessedMemberTypes
dynamicallyAccessedMemberTypes)
TrimAnalysis\GenericArgumentDataFlow.cs (2)
46
if (genericParameterValue.DynamicallyAccessedMemberTypes !=
DynamicallyAccessedMemberTypes
.None) {
102
if (genericParameterValue.DynamicallyAccessedMemberTypes !=
DynamicallyAccessedMemberTypes
.None)
TrimAnalysis\GenericParameterValue.cs (2)
18
public GenericParameterValue (ITypeParameterSymbol typeParameterSymbol,
DynamicallyAccessedMemberTypes
dynamicallyAccessedMemberTypes)
29
public override
DynamicallyAccessedMemberTypes
DynamicallyAccessedMemberTypes { get; }
TrimAnalysis\HandleCallAction.cs (4)
92
DynamicallyAccessedMemberTypes
annotation = default;
96
annotation =
DynamicallyAccessedMemberTypes
.PublicFields;
124
AddReturnValue (FlowAnnotations.Instance.GetMethodReturnValue (calledMethod, _isNewObj,
DynamicallyAccessedMemberTypes
.PublicFields));
126
var
annotation = FlowAnnotations.GetTypeAnnotation (staticType);
TrimAnalysis\MethodParameterValue.cs (3)
14
public MethodParameterValue (IMethodSymbol methodSymbol, ParameterIndex parameterIndex,
DynamicallyAccessedMemberTypes
dynamicallyAccessedMemberTypes)
20
public MethodParameterValue (ParameterProxy parameter,
DynamicallyAccessedMemberTypes
dynamicallyAccessedMemberTypes)
27
public override
DynamicallyAccessedMemberTypes
DynamicallyAccessedMemberTypes { get; }
TrimAnalysis\MethodReturnValue.cs (2)
20
public MethodReturnValue (IMethodSymbol methodSymbol, bool isNewObj,
DynamicallyAccessedMemberTypes
dynamicallyAccessedMemberTypes)
30
public override
DynamicallyAccessedMemberTypes
DynamicallyAccessedMemberTypes { get; }
TrimAnalysis\ReflectionAccessAnalyzer.cs (4)
27
internal void GetReflectionAccessDiagnostics (Location location, ITypeSymbol typeSymbol,
DynamicallyAccessedMemberTypes
requiredMemberTypes, bool declaredOnly = false)
154
if (methodSymbol.IsVirtual && FlowAnnotations.GetMethodReturnValueAnnotation (methodSymbol) !=
DynamicallyAccessedMemberTypes
.None) {
158
if (FlowAnnotations.GetMethodParameterAnnotation (parameter) !=
DynamicallyAccessedMemberTypes
.None) {
194
if (FlowAnnotations.GetFieldAnnotation (fieldSymbol) !=
DynamicallyAccessedMemberTypes
.None) {
TrimAnalysis\RequireDynamicallyAccessedMembersAction.cs (1)
37
private partial void MarkTypeForDynamicallyAccessedMembers (in TypeProxy type,
DynamicallyAccessedMemberTypes
dynamicallyAccessedMemberTypes) =>