278 references to DependencyKind
illink (278)
Linker.Dataflow\DynamicallyAccessedMembersTypeHierarchy.cs (3)
237
_reflectionMarker.MarkTypeForDynamicallyAccessedMembers(origin, baseType, annotationToApplyToBase,
DependencyKind
.DynamicallyAccessedMemberOnType, declaredOnly: false);
261
_reflectionMarker.MarkTypeForDynamicallyAccessedMembers(origin, interfaceType, annotationToApplyToInterfaces,
DependencyKind
.DynamicallyAccessedMemberOnType, declaredOnly: false);
269
_reflectionMarker.MarkTypeForDynamicallyAccessedMembers(origin, type, annotation,
DependencyKind
.DynamicallyAccessedMemberOnType, declaredOnly: true);
Linker.Dataflow\GenericArgumentDataFlow.cs (1)
60
reflectionMarker.MarkTypeForDynamicallyAccessedMembers(diagnosticContext.Origin, genericArgument, DynamicallyAccessedMemberTypes.PublicParameterlessConstructor,
DependencyKind
.DefaultCtorForNewConstrainedGenericArgument);
Linker.Dataflow\ReflectionMarker.cs (16)
29
internal void MarkTypeForDynamicallyAccessedMembers(in MessageOrigin origin, TypeReference type, DynamicallyAccessedMemberTypes requiredMemberTypes,
DependencyKind
dependencyKind, bool declaredOnly = false)
103
_markStep.MarkTypeVisibleToReflection(typeReference, new DependencyInfo(
DependencyKind
.AccessedViaReflection, origin.Provider), origin);
106
Context.MarkingHelpers.MarkMatchingExportedType(typeResolutionRecord.ResolvedType, typeResolutionRecord.ReferringAssembly, new DependencyInfo(
DependencyKind
.DynamicallyAccessedMember, typeReference), origin);
111
internal void MarkType(in MessageOrigin origin, TypeReference typeRef,
DependencyKind
dependencyKind =
DependencyKind
.AccessedViaReflection)
122
internal void MarkMethod(in MessageOrigin origin, MethodReference methodRef,
DependencyKind
dependencyKind =
DependencyKind
.AccessedViaReflection)
133
void MarkField(in MessageOrigin origin, FieldDefinition field,
DependencyKind
dependencyKind =
DependencyKind
.AccessedViaReflection)
141
internal void MarkProperty(in MessageOrigin origin, PropertyDefinition property,
DependencyKind
dependencyKind =
DependencyKind
.AccessedViaReflection)
149
void MarkEvent(in MessageOrigin origin, EventDefinition @event,
DependencyKind
dependencyKind =
DependencyKind
.AccessedViaReflection)
157
void MarkInterfaceImplementation(in MessageOrigin origin, InterfaceImplementation interfaceImplementation,
DependencyKind
dependencyKind =
DependencyKind
.AccessedViaReflection)
221
_markStep.MarkStaticConstructorVisibleToReflection(type, new DependencyInfo(
DependencyKind
.AccessedViaReflection, origin.Provider), origin, suppressTrimAnalysisWarnings: _suppressTrimAnalysisWarnings);
Linker.Dataflow\RequireDynamicallyAccessedMembersAction.cs (1)
47
_reflectionMarker.MarkTypeForDynamicallyAccessedMembers(_diagnosticContext.Origin, type.Type, dynamicallyAccessedMemberTypes,
DependencyKind
.DynamicallyAccessedMember);
Linker.Steps\DescriptorMarker.cs (8)
63
_context.MarkingHelpers.MarkExportedType(exportedType, assembly.MainModule, new DependencyInfo(
DependencyKind
.XmlDescriptor, assembly.MainModule), GetMessageOriginForPosition(nav));
99
_context.Annotations.Mark(type, new DependencyInfo(
DependencyKind
.XmlDescriptor, _xmlDocumentLocation), GetMessageOriginForPosition(nav));
111
_context.MarkingHelpers.MarkExportedType(exported, assembly.MainModule, new DependencyInfo(
DependencyKind
.XmlDescriptor, _xmlDocumentLocation), GetMessageOriginForPosition(nav));
121
_context.MarkingHelpers.MarkExportedType(currentType, assembly.MainModule, new DependencyInfo(
DependencyKind
.DeclaringType, currentType), GetMessageOriginForPosition(nav));
165
_context.Annotations.Mark(type, new DependencyInfo(
DependencyKind
.XmlDescriptor, _xmlDocumentLocation), GetMessageOriginForPosition(nav));
173
_context.Annotations.Mark(parent, new DependencyInfo(
DependencyKind
.DeclaringType, currentType), GetMessageOriginForPosition(nav));
195
var reason = new DependencyInfo(
DependencyKind
.XmlDescriptor, _xmlDocumentLocation);
215
var reason = new DependencyInfo(
DependencyKind
.XmlDescriptor, _xmlDocumentLocation);
Linker.Steps\DiscoverCustomOperatorsHandler.cs (1)
90
Context.Annotations.Mark(method, new DependencyInfo(
DependencyKind
.PreservedOperator, method.DeclaringType), new MessageOrigin(method.DeclaringType));
Linker.Steps\MarkExportedTypesTargetStep.cs (1)
37
context.Annotations.Mark(type, new DependencyInfo(
DependencyKind
.ExportedType, exportedType), new MessageOrigin(assembly));
Linker.Steps\MarkStep.cs (205)
354
MarkEntireType(nested, new DependencyInfo(
DependencyKind
.NestedType, type), origin);
367
MarkFieldsVisibleToReflection(type, new DependencyInfo(
DependencyKind
.MemberOfType, type), origin);
368
MarkMethodsVisibleToReflection(type, new DependencyInfo(
DependencyKind
.MemberOfType, type), origin);
374
MarkPropertyVisibleToReflection(property, new DependencyInfo(
DependencyKind
.MemberOfType, type), origin);
382
MarkEventVisibleToReflection(ev, new DependencyInfo(
DependencyKind
.MemberOfType, type), origin);
444
MarkAssembly(assembly, new DependencyInfo(
DependencyKind
.AssemblyAction, null), emptyOrigin);
676
MarkType(type, new DependencyInfo(
DependencyKind
.DynamicInterfaceCastableImplementation, iface.InterfaceType), new MessageOrigin(Context.TryResolve(iface.InterfaceType)));
719
MarkMethod(dimInfo.Override, new DependencyInfo(
DependencyKind
.Override, dimInfo.Base), origin);
729
MarkMethod(ov.Override, new DependencyInfo(
DependencyKind
.Override, ov.Base), origin);
774
MarkMethod(overrideInformation.Override, new DependencyInfo(
DependencyKind
.OverrideOnInstantiatedType, overrideInformation.Override.DeclaringType), origin);
780
MarkMethod(overrideInformation.Override, new DependencyInfo(
DependencyKind
.Override, overrideInformation.Base), origin);
981
MarkingHelpers.MarkMatchingExportedType(type, assembly, new DependencyInfo(
DependencyKind
.DynamicDependency, type), origin);
1023
MarkMembersVisibleToReflection(members, new DependencyInfo(
DependencyKind
.DynamicDependency, context), origin);
1094
MarkingHelpers.MarkMatchingExportedType(td, assemblyDef, new DependencyInfo(
DependencyKind
.PreservedDependency, ca), origin);
1122
MarkEntireType(td, new DependencyInfo(
DependencyKind
.PreservedDependency, ca), origin);
1128
if (MarkDependencyMethod(td, member, signature, new DependencyInfo(
DependencyKind
.PreservedDependency, ca), origin))
1131
if (MarkNamedField(td, member, new DependencyInfo(
DependencyKind
.PreservedDependency, ca), origin))
1205
MarkMethod(ca.Constructor, new DependencyInfo(
DependencyKind
.AttributeConstructor, ca), origin);
1332
MarkType(security_type, new DependencyInfo(
DependencyKind
.AttributeType, sa), origin);
1343
MarkCustomAttributeProperty(named_argument, attribute, ca, new DependencyInfo(
DependencyKind
.AttributeProperty, ca), origin);
1389
MarkField(field, new DependencyInfo(
DependencyKind
.CustomAttributeField, ca), origin);
1454
MarkType(et, new DependencyInfo(
DependencyKind
.CustomAttributeArgumentType, ca), origin);
1471
MarkType(argument.Type, new DependencyInfo(
DependencyKind
.CustomAttributeArgumentType, ca), origin);
1472
MarkType((TypeReference)argument.Value, new DependencyInfo(
DependencyKind
.CustomAttributeArgumentValue, ca), origin);
1477
MarkType(boxed_value.Type, new DependencyInfo(
DependencyKind
.CustomAttributeArgumentType, ca), origin);
1533
MarkSecurityDeclarations(assembly, new DependencyInfo(
DependencyKind
.AssemblyOrModuleAttribute, assembly), assemblyOrigin);
1545
MarkCustomAttributes(assembly, new DependencyInfo(
DependencyKind
.AssemblyOrModuleAttribute, assembly), origin);
1546
MarkCustomAttributes(module, new DependencyInfo(
DependencyKind
.AssemblyOrModuleAttribute, module), origin);
1549
MarkEntireType(type, new DependencyInfo(
DependencyKind
.TypeInAssembly, assembly), origin);
1558
MarkingHelpers.MarkExportedType(exportedType, module, new DependencyInfo(
DependencyKind
.ExportedType, assembly), origin);
1619
MarkType(moduleType, new DependencyInfo(
DependencyKind
.TypeInAssembly, assembly), origin);
1661
MarkCustomAttribute(customAttribute, new DependencyInfo(
DependencyKind
.AssemblyOrModuleAttribute, assemblyLevelAttribute.Provider), assemblyOrigin);
1732
Debug.Assert(reason.Kind ==
DependencyKind
.FieldAccess || reason.Kind ==
DependencyKind
.Ldtoken);
1735
MarkType(reference.DeclaringType, new DependencyInfo(
DependencyKind
.DeclaringType, reference), origin);
1738
reason = new DependencyInfo(
DependencyKind
.FieldOnGenericInstance, reference);
1751
void ReportWarningsForReflectionAccess(in MessageOrigin origin, MethodDefinition method,
DependencyKind
dependencyKind, bool suppressTrimAnalysisWarnings)
1765
case
DependencyKind
.AttributeProperty:
1772
case
DependencyKind
.Ldftn:
1773
case
DependencyKind
.Ldvirtftn:
1774
case
DependencyKind
.Ldtoken:
1782
case
DependencyKind
.AttributeConstructor:
1813
case
DependencyKind
.AttributeConstructor:
1814
case
DependencyKind
.AttributeProperty:
1875
if (reason.Kind ==
DependencyKind
.AlreadyMarked)
1890
MarkType(field.DeclaringType, new DependencyInfo(
DependencyKind
.DeclaringType, field), origin);
1893
MarkType(field.FieldType, new DependencyInfo(
DependencyKind
.FieldType, field), fieldOrigin);
1894
MarkCustomAttributes(field, new DependencyInfo(
DependencyKind
.CustomAttribute, field), fieldOrigin);
1895
MarkMarshalSpec(field, new DependencyInfo(
DependencyKind
.FieldMarshalSpec, field), fieldOrigin);
1924
DependencyKind
.FieldAccess => new DependencyInfo(
DependencyKind
.TriggersCctorThroughFieldAccess, reason.Source),
1925
_ => new DependencyInfo(
DependencyKind
.CctorForField, field)
1931
void ProcessAnalysisAnnotationsForField(FieldDefinition field,
DependencyKind
dependencyKind, in MessageOrigin origin, bool suppressTrimAnalysisWarnings)
1936
case
DependencyKind
.AlreadyMarked:
1937
case
DependencyKind
.TypePreserve:
1938
case
DependencyKind
.PreservedMethod:
1939
case
DependencyKind
.MemberOfType:
1942
case
DependencyKind
.DynamicallyAccessedMemberOnType:
1961
case
DependencyKind
.AccessedViaReflection:
1962
case
DependencyKind
.DynamicDependency:
1963
case
DependencyKind
.DynamicallyAccessedMember:
1964
case
DependencyKind
.InteropMethodDependency:
1965
case
DependencyKind
.Ldtoken:
1966
case
DependencyKind
.UnsafeAccessorTarget:
1985
if (reason.Kind ==
DependencyKind
.AlreadyMarked)
1995
MarkAssembly(module.Assembly, new DependencyInfo(
DependencyKind
.AssemblyOfModule, module), origin);
2008
MarkDefaultConstructor(type, new DependencyInfo(
DependencyKind
.SerializationMethodForType, type), origin);
2009
MarkMethodsIf(type.Methods, IsSpecialSerializationConstructor, new DependencyInfo(
DependencyKind
.SerializationMethodForType, type), origin);
2012
MarkMethodsIf(type.Methods, HasOnSerializeOrDeserializeAttribute, new DependencyInfo(
DependencyKind
.SerializationMethodForType, type), origin);
2046
MarkTypeVisibleToReflection(methodDefinition.DeclaringType, new DependencyInfo(
DependencyKind
.DeclaringType, methodDefinition), origin);
2101
MarkTypeVisibleToReflection(fieldDefinition.DeclaringType, new DependencyInfo(
DependencyKind
.DeclaringType, fieldDefinition), origin);
2211
case
DependencyKind
.AlreadyMarked:
2220
if (type.HasMethods && ShouldMarkTypeStaticConstructor(type) && reason.Kind ==
DependencyKind
.DeclaringTypeOfCalledMethod)
2221
MarkStaticConstructor(type, new DependencyInfo(
DependencyKind
.TriggersCctorForCalledMethod, reason.Source), origin);
2231
reason.Kind is not
DependencyKind
.TypeInAssembly)
2243
MarkModule(module, new DependencyInfo(
DependencyKind
.ScopeOfType, type), origin);
2250
MarkType(type.BaseType, new DependencyInfo(
DependencyKind
.BaseType, type), typeOrigin);
2258
MarkType(type.DeclaringType, new DependencyInfo(
DependencyKind
.DeclaringType, type), typeOrigin);
2259
MarkCustomAttributes(type, new DependencyInfo(
DependencyKind
.CustomAttribute, type), typeOrigin);
2260
MarkSecurityDeclarations(type, new DependencyInfo(
DependencyKind
.CustomAttribute, type), typeOrigin);
2268
MarkMethodIf(type.Methods, static m => m.Name == "Finalize", new DependencyInfo(
DependencyKind
.MethodForSpecialType, type), typeOrigin);
2329
MarkMethod(method, new DependencyInfo(
DependencyKind
.VirtualNeededDueToPreservedScope, type), typeOrigin);
2332
if (ShouldMarkTypeStaticConstructor(type) && reason.Kind !=
DependencyKind
.TriggersCctorForCalledMethod)
2334
MarkStaticConstructor(type, new DependencyInfo(
DependencyKind
.CctorForType, type), typeOrigin);
2428
if (MarkMethodsIf(type.Methods, MethodDefinitionExtensions.IsPublicInstancePropertyMethod, new DependencyInfo(
DependencyKind
.ReferencedBySpecialAttribute, type), origin))
2429
Tracer.AddDirectDependency(attribute, new DependencyInfo(
DependencyKind
.CustomAttribute, type), marked: false);
2455
Tracer.AddDirectDependency(attribute, new DependencyInfo(
DependencyKind
.CustomAttribute, type), marked: false);
2456
MarkNamedMethod(type, name, new DependencyInfo(
DependencyKind
.ReferencedBySpecialAttribute, attribute), origin);
2472
Tracer.AddDirectDependency(attribute, new DependencyInfo(
DependencyKind
.CustomAttribute, type), marked: false);
2519
MarkMethodVisibleToReflection(method, new DependencyInfo(
DependencyKind
.ReferencedBySpecialAttribute, attribute), origin);
2528
MarkFieldVisibleToReflection(field, new DependencyInfo(
DependencyKind
.ReferencedBySpecialAttribute, attribute), origin);
2535
MarkPropertyVisibleToReflection(property, new DependencyInfo(
DependencyKind
.ReferencedBySpecialAttribute, attribute), origin);
2544
MarkMethodsVisibleToReflection(type, new DependencyInfo(
DependencyKind
.KeptForSpecialAttribute, attribute), origin);
2545
MarkFieldsVisibleToReflection(type, new DependencyInfo(
DependencyKind
.ReferencedBySpecialAttribute, attribute), origin);
2573
Tracer.AddDirectDependency(attribute, new DependencyInfo(
DependencyKind
.CustomAttribute, type), marked: false);
2574
MarkType(proxyTypeReference, new DependencyInfo(
DependencyKind
.ReferencedBySpecialAttribute, attribute), origin);
2578
MarkMethodsVisibleToReflection(proxyType, new DependencyInfo(
DependencyKind
.ReferencedBySpecialAttribute, attribute), origin);
2579
MarkFieldsVisibleToReflection(proxyType, new DependencyInfo(
DependencyKind
.ReferencedBySpecialAttribute, attribute), origin);
2619
MarkNamedField(method.DeclaringType, member_name, new DependencyInfo(
DependencyKind
.ReferencedBySpecialAttribute, attribute), origin);
2620
MarkNamedProperty(method.DeclaringType, member_name, new DependencyInfo(
DependencyKind
.ReferencedBySpecialAttribute, attribute), origin);
2704
MarkCustomAttributes(parameter, new DependencyInfo(
DependencyKind
.GenericParameterCustomAttribute, parameter.Owner), origin);
2710
MarkCustomAttributes(constraint, new DependencyInfo(
DependencyKind
.GenericParameterConstraintCustomAttribute, parameter.Owner), origin);
2711
MarkType(constraint.ConstraintType, new DependencyInfo(
DependencyKind
.GenericParameterConstraintType, parameter.Owner), origin);
2956
MarkStaticFields(nestedType, new DependencyInfo(
DependencyKind
.EventSourceProviderField, td), origin);
2962
MarkMethodsIf(type.Methods, m => m.Name == ".ctor" || m.Name == "Invoke", new DependencyInfo(
DependencyKind
.MethodForSpecialType, type), origin);
2981
MarkType(fnptr.ReturnType, new DependencyInfo(
DependencyKind
.ReturnType, fnptr), origin);
2988
(type, reason) = (specification.ElementType, new DependencyInfo(
DependencyKind
.ElementType, specification));
3001
MarkType(fnptr.Parameters[i].ParameterType, new DependencyInfo(
DependencyKind
.ParameterType, fnptr), origin);
3007
MarkType(mod.ModifierType, new DependencyInfo(
DependencyKind
.ModifierType, mod), origin);
3018
var argumentTypeDef = MarkType(argument, new DependencyInfo(
DependencyKind
.GenericArgumentType, instance), origin);
3046
var di = new DependencyInfo(
DependencyKind
.TypePreserve, type);
3068
var di = new DependencyInfo(
DependencyKind
.TypePreserve, type);
3144
MarkMethodCollection(list, new DependencyInfo(
DependencyKind
.PreservedMethod, type), origin);
3154
MarkMethodCollection(list, new DependencyInfo(
DependencyKind
.PreservedMethod, method), origin);
3224
MarkType(reference.DeclaringType, new DependencyInfo(
DependencyKind
.DeclaringType, reference), origin);
3237
MarkType(reference.DeclaringType, new DependencyInfo(
DependencyKind
.DeclaringType, reference), origin);
3239
reason = new DependencyInfo(
DependencyKind
.MethodOnGenericInstance, reference);
3256
case
DependencyKind
.AlreadyMarked:
3265
reason.Kind ==
DependencyKind
.DirectCall ||
3266
reason.Kind ==
DependencyKind
.VirtualCall ||
3267
reason.Kind ==
DependencyKind
.Newobj;
3275
MarkType(method.DeclaringType, new DependencyInfo(
DependencyKind
.DeclaringTypeOfCalledMethod, method), new MessageOrigin(reason.Source as IMemberDefinition ?? method));
3279
&& reason.Kind !=
DependencyKind
.EventMethod)
3281
var
kind = PropagateDependencyKindToAccessors(reason.Kind,
DependencyKind
.EventOfEventMethod);
3308
void ProcessAnalysisAnnotationsForMethod(MethodDefinition method,
DependencyKind
dependencyKind, in MessageOrigin origin, bool suppressTrimAnalysisWarnings)
3317
case
DependencyKind
.DirectCall:
3318
case
DependencyKind
.VirtualCall:
3319
case
DependencyKind
.Newobj:
3322
case
DependencyKind
.MethodForSpecialType:
3325
case
DependencyKind
.AlreadyMarked:
3326
case
DependencyKind
.TypePreserve:
3327
case
DependencyKind
.PreservedMethod:
3334
case
DependencyKind
.BaseMethod:
3335
case
DependencyKind
.MethodImplOverride:
3336
case
DependencyKind
.Override:
3337
case
DependencyKind
.OverrideOnInstantiatedType:
3343
case
DependencyKind
.MethodForInstantiatedType:
3344
case
DependencyKind
.VirtualNeededDueToPreservedScope:
3352
case
DependencyKind
.MemberOfType:
3353
case
DependencyKind
.EventMethod:
3357
case
DependencyKind
.CctorForType:
3358
case
DependencyKind
.CctorForField:
3359
case
DependencyKind
.TriggersCctorThroughFieldAccess:
3360
case
DependencyKind
.TriggersCctorForCalledMethod:
3363
case
DependencyKind
.UnreachableBodyRequirement:
3365
case
DependencyKind
.Custom:
3366
case
DependencyKind
.Unspecified:
3370
case
DependencyKind
.KeptForSpecialAttribute:
3373
case
DependencyKind
.DynamicallyAccessedMemberOnType:
3405
(method, reason) = (specification.ElementMethod, new DependencyInfo(
DependencyKind
.ElementMethod, specification));
3421
reason.Kind ==
DependencyKind
.DirectCall ||
3422
reason.Kind ==
DependencyKind
.VirtualCall ||
3423
reason.Kind ==
DependencyKind
.Newobj;
3429
MarkType(method.DeclaringType, new DependencyInfo(
DependencyKind
.DeclaringType, method), methodOrigin);
3430
MarkCustomAttributes(method, new DependencyInfo(
DependencyKind
.CustomAttribute, method), methodOrigin);
3431
MarkSecurityDeclarations(method, new DependencyInfo(
DependencyKind
.CustomAttribute, method), methodOrigin);
3438
Tracer.AddDirectDependency(method.DeclaringType, new DependencyInfo(
DependencyKind
.InstantiatedByCtor, method), marked: false);
3451
MarkProperty(property, new DependencyInfo(PropagateDependencyKindToAccessors(reason.Kind,
DependencyKind
.PropertyOfPropertyMethod), method));
3458
MarkType(pd.ParameterType, new DependencyInfo(
DependencyKind
.ParameterType, method), methodOrigin);
3459
MarkCustomAttributes(pd, new DependencyInfo(
DependencyKind
.ParameterAttribute, method), methodOrigin);
3460
MarkMarshalSpec(pd, new DependencyInfo(
DependencyKind
.ParameterMarshalSpec, method), methodOrigin);
3483
MarkMethod(@base, new DependencyInfo(
DependencyKind
.MethodImplOverride, method), methodOrigin);
3506
MarkType(method.ReturnType, new DependencyInfo(
DependencyKind
.ReturnType, method), methodOrigin);
3507
MarkCustomAttributes(method.MethodReturnType, new DependencyInfo(
DependencyKind
.ReturnTypeAttribute, method), methodOrigin);
3508
MarkMarshalSpec(method.MethodReturnType, new DependencyInfo(
DependencyKind
.ReturnTypeMarshalSpec, method), methodOrigin);
3534
MarkMethodIf(declaringType.Methods, m => m.Name == methodPair, new DependencyInfo(
DependencyKind
.MethodForSpecialType, declaringType), methodOrigin);
3548
static
DependencyKind
PropagateDependencyKindToAccessors(
DependencyKind
parentDependencyKind,
DependencyKind
kind)
3553
case
DependencyKind
.AlreadyMarked:
3554
case
DependencyKind
.TypePreserve:
3555
case
DependencyKind
.PreservedMethod:
3556
case
DependencyKind
.DynamicallyAccessedMemberOnType:
3571
MarkFields(type, includeStatic: type.IsEnum, reason: new DependencyInfo(
DependencyKind
.MemberOfType, type), origin);
3644
if (!MarkDefaultConstructor(baseType, new DependencyInfo(
DependencyKind
.BaseDefaultCtorForStubbedMethod, method), origin))
3650
MarkAndCacheConvertToThrowExceptionCtor(new DependencyInfo(
DependencyKind
.UnreachableBodyRequirement, method), origin);
3693
var ctor = MarkMethodIf(disablePrivateReflection.Methods, MethodDefinitionExtensions.IsDefaultConstructor, new DependencyInfo(
DependencyKind
.DisablePrivateReflectionRequirement, disablePrivateReflection), emptyOrigin);
3718
MarkMethod(ov.Base, new DependencyInfo(
DependencyKind
.BaseMethod, method), origin);
3728
Annotations.MarkProcessed(pii.Module, new DependencyInfo(
DependencyKind
.InteropMethodDependency, method));
3748
MarkDefaultConstructor(returnTypeDefinition, new DependencyInfo(
DependencyKind
.InteropMethodDependency, method), origin);
3749
MarkFields(returnTypeDefinition, includeStaticFields, new DependencyInfo(
DependencyKind
.InteropMethodDependency, method), origin);
3756
MarkFields(method.DeclaringType, includeStaticFields, new DependencyInfo(
DependencyKind
.InteropMethodDependency, method), origin);
3773
MarkFields(paramTypeDefinition, includeStaticFields, new DependencyInfo(
DependencyKind
.InteropMethodDependency, method), origin);
3776
MarkDefaultConstructor(paramTypeDefinition, new DependencyInfo(
DependencyKind
.InteropMethodDependency, method), origin);
3826
MarkCustomAttributes(prop, new DependencyInfo(
DependencyKind
.CustomAttribute, prop), propertyOrigin);
3833
DependencyKind
dependencyKind =
DependencyKind
.EventMethod;
3843
MarkCustomAttributes(evt, new DependencyInfo(
DependencyKind
.CustomAttribute, evt), eventOrigin);
3861
MarkAndCacheConvertToThrowExceptionCtor(new DependencyInfo(
DependencyKind
.UnreachableBodyRequirement, body.Method), origin);
3953
MarkType(var.VariableType, new DependencyInfo(
DependencyKind
.VariableType, methodIL.Method), origin);
3957
MarkType(eh.CatchType, new DependencyInfo(
DependencyKind
.CatchType, methodIL.Method), origin);
4037
MarkField((FieldReference)instruction.Operand, new DependencyInfo(
DependencyKind
.FieldAccess, method), origin);
4042
(
DependencyKind
dependencyKind, bool markForReflectionAccess) = instruction.OpCode.Code switch
4044
Code.Jmp => (
DependencyKind
.DirectCall, false),
4045
Code.Call => (
DependencyKind
.DirectCall, false),
4046
Code.Callvirt => (
DependencyKind
.VirtualCall, false),
4047
Code.Newobj => (
DependencyKind
.Newobj, false),
4048
Code.Ldvirtftn => (
DependencyKind
.Ldvirtftn, true),
4049
Code.Ldftn => (
DependencyKind
.Ldftn, true),
4074
var reason = new DependencyInfo(
DependencyKind
.Ldtoken, method);
4134
MarkType(operand, new DependencyInfo(
DependencyKind
.InstructionTypeRef, method), origin);
4151
Annotations.MarkProcessed(iface, reason ?? new DependencyInfo(
DependencyKind
.InterfaceImplementationOnType, origin.Provider));
4161
MarkCustomAttributes(iface, new DependencyInfo(
DependencyKind
.CustomAttribute, iface), origin);
4163
MarkType(iface.InterfaceType, reason ?? new DependencyInfo(
DependencyKind
.InterfaceImplementationInterfaceType, iface), origin);
Linker.Steps\ProcessReferencesStep.cs (1)
50
Annotations.Mark(assembly.MainModule, new DependencyInfo(
DependencyKind
.AssemblyAction, assembly), new MessageOrigin(assembly));
Linker.Steps\ReflectionBlockedStep.cs (1)
83
Annotations.Mark(ca, new DependencyInfo(
DependencyKind
.DisablePrivateReflection, ca));
Linker.Steps\RootAssemblyInputStep.cs (5)
26
var di = new DependencyInfo(
DependencyKind
.RootAssembly, assembly);
139
Annotations.Mark(type, new DependencyInfo(
DependencyKind
.RootAssembly, type.Module.Assembly), new MessageOrigin(type.Module.Assembly));
156
Annotations.Mark(type, new DependencyInfo(
DependencyKind
.RootAssembly, type.Module.Assembly), new MessageOrigin(type.Module.Assembly));
170
var di = new DependencyInfo(
DependencyKind
.RootAssembly, assembly);
193
Context.Annotations.Mark(attribute, new DependencyInfo(
DependencyKind
.RootAssembly, assembly));
Linker.Steps\UnsafeAccessorMarker.cs (5)
97
_context.MarkingHelpers.MarkMatchingExportedType(typeResolutionRecord.ResolvedType, typeResolutionRecord.ReferringAssembly, new DependencyInfo(
DependencyKind
.AccessedViaReflection, method), new MessageOrigin(method));
114
_context.MarkingHelpers.MarkMatchingExportedType(typeResolutionRecord.ResolvedType, typeResolutionRecord.ReferringAssembly, new DependencyInfo(
DependencyKind
.AccessedViaReflection, method), new MessageOrigin(method));
164
_markStep.MarkMethodVisibleToReflection(targetMethod, new DependencyInfo(
DependencyKind
.UnsafeAccessorTarget, method), new MessageOrigin(method));
189
_markStep.MarkMethodVisibleToReflection(targetMethod, new DependencyInfo(
DependencyKind
.UnsafeAccessorTarget, method), new MessageOrigin(method));
217
_markStep.MarkFieldVisibleToReflection(targetField, new DependencyInfo(
DependencyKind
.UnsafeAccessorTarget, method), new MessageOrigin(method));
Linker\Annotations.cs (3)
166
Debug.Assert(!(reason.Kind ==
DependencyKind
.AlreadyMarked));
180
Debug.Assert(!(reason.Kind ==
DependencyKind
.AlreadyMarked));
548
Mark(method, new DependencyInfo(
DependencyKind
.PreservedMethod, definition), new MessageOrigin(definition));
Linker\DependencyInfo.cs (5)
155
public
DependencyKind
Kind { get; }
157
public DependencyInfo(
DependencyKind
kind, object? source) => (Kind, Source) = (kind, source);
158
public static readonly DependencyInfo Unspecified = new DependencyInfo(
DependencyKind
.Unspecified, null);
159
public static readonly DependencyInfo AlreadyMarked = new DependencyInfo(
DependencyKind
.AlreadyMarked, null);
160
public static readonly DependencyInfo DisablePrivateReflectionRequirement = new DependencyInfo(
DependencyKind
.DisablePrivateReflectionRequirement, null);
Linker\DgmlDependencyRecorder.cs (1)
118
if (reason.Kind ==
DependencyKind
.Unspecified)
Linker\MarkingHelpers.cs (1)
45
MarkExportedType(exportedType, assembly.MainModule, new DependencyInfo(
DependencyKind
.ExportedType, typeReference), origin);
Linker\SerializationMarker.cs (12)
87
static
DependencyKind
ToDependencyKind(SerializerKind serializerKind) => serializerKind switch
89
SerializerKind.DataContractSerializer =>
DependencyKind
.DataContractSerialized,
90
SerializerKind.XmlSerializer =>
DependencyKind
.XmlSerialized,
188
MarkRecursiveMembersInternal(argType, new DependencyInfo(
DependencyKind
.GenericArgumentType, typeRef));
191
typeReason = new DependencyInfo(
DependencyKind
.ElementType, typeRef);
209
MarkRecursiveMembersInternal(type.BaseType, new DependencyInfo(
DependencyKind
.SerializedRecursiveType, type));
219
MarkRecursiveMembersInternal(field.FieldType, new DependencyInfo(
DependencyKind
.SerializedRecursiveType, type));
220
_context.Annotations.Mark(field, new DependencyInfo(
DependencyKind
.SerializedMember, type), new MessageOrigin(type));
235
MarkRecursiveMembersInternal(property.PropertyType, new DependencyInfo(
DependencyKind
.SerializedRecursiveType, type));
237
_context.Annotations.Mark(get, new DependencyInfo(
DependencyKind
.SerializedMember, type), new MessageOrigin(type));
239
_context.Annotations.Mark(set, new DependencyInfo(
DependencyKind
.SerializedMember, type), new MessageOrigin(type));
252
_context.Annotations.Mark(method, new DependencyInfo(
DependencyKind
.SerializedMember, type), new MessageOrigin(type));
Linker\TypeMapHandler.cs (7)
80
MarkTypeMapAttribute(entry, new DependencyInfo(
DependencyKind
.TypeMapEntry, callingMethod));
100
MarkTypeMapAttribute(entry, new DependencyInfo(
DependencyKind
.TypeMapEntry, callingMethod));
137
MarkTypeMapAttribute(entry, new DependencyInfo(
DependencyKind
.TypeMapAssemblyTarget, callingMethod));
155
MarkTypeMapAttribute(attr, new DependencyInfo(
DependencyKind
.TypeMapAssemblyTarget, callingMethod));
179
MarkTypeMapAttribute(attr, new DependencyInfo(
DependencyKind
.TypeMapEntry, targetType));
266
MarkTypeMapAttribute(attr, new DependencyInfo(
DependencyKind
.TypeMapEntry, null));
286
MarkTypeMapAttribute(attr, new DependencyInfo(
DependencyKind
.TypeMapEntry, dependencySource));
Linker\XmlDependencyRecorder.cs (1)
102
if (reason.Kind ==
DependencyKind
.Unspecified)