1 write to _context
illink (1)
Linker.Steps\ProcessLinkerXmlBase.cs (1)
48
_context
= context;
53 references to _context
illink (53)
Linker.Steps\BodySubstitutionParser.cs (3)
31
bool stripSubstitutions =
_context
.IsOptimizationEnabled(CodeOptimizations.RemoveSubstitutions, _resource?.Assembly);
32
ProcessXml(stripSubstitutions,
_context
.IgnoreSubstitutions);
163
_context
.Annotations.AddResourceToRemove(assembly, resource);
Linker.Steps\DescriptorMarker.cs (16)
44
_context
.LogMessage(MessageContainer.CreateInfoMessage(origin, $"Duplicate preserve of '{memberName}'"));
49
bool stripDescriptors =
_context
.IsOptimizationEnabled(CodeOptimizations.RemoveDescriptors, _resource?.Assembly);
50
ProcessXml(stripDescriptors,
_context
.IgnoreDescriptors);
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));
100
_context
.Annotations.SetPreserve(type, TypePreserve.All);
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));
147
_context
.Annotations.SetPreserve(type, preserve);
157
_context
.Annotations.Mark(type, new DependencyInfo(DependencyKind.XmlDescriptor, _xmlDocumentLocation), GetMessageOriginForPosition(nav));
165
_context
.Annotations.Mark(parent, new DependencyInfo(DependencyKind.DeclaringType, currentType), GetMessageOriginForPosition(nav));
187
_context
.Annotations.Mark(field, new DependencyInfo(DependencyKind.XmlDescriptor, _xmlDocumentLocation), GetMessageOriginForPosition(nav));
195
_context
.Annotations.MarkIndirectlyCalledMethod(method);
196
_context
.Annotations.SetAction(method, MethodAction.Parse);
200
_context
.Annotations.AddPreservedMethod(type, method);
204
_context
.Annotations.Mark(method, new DependencyInfo(DependencyKind.XmlDescriptor, _xmlDocumentLocation), GetMessageOriginForPosition(nav));
Linker.Steps\LinkAttributesParser.cs (26)
35
bool stripLinkAttributes =
_context
.IsOptimizationEnabled(CodeOptimizations.RemoveLinkAttributes, _resource?.Assembly);
36
ProcessXml(stripLinkAttributes,
_context
.IgnoreLinkAttributes);
85
_context
.LogMessage($"Assigning external custom attribute '{FormatCustomAttribute(customAttribute)}' instance to '{provider}'.");
115
if (
_context
.MarkedKnownMembers.RemoveAttributeInstancesAttributeDefinition is TypeDefinition knownTypeDef)
120
var voidType = BCL.FindPredefinedType(WellKnownType.System_Void,
_context
);
124
var attributeType = BCL.FindPredefinedType(WellKnownType.System_Attribute,
_context
);
128
var objectType = BCL.FindPredefinedType(WellKnownType.System_Object,
_context
);
163
return
_context
.MarkedKnownMembers.RemoveAttributeInstancesAttributeDefinition = td;
204
var parameterType =
_context
.TryResolve(p.ParameterType);
205
if (parameterType == null || parameterType !=
_context
.TryResolve(args[p.MetadataIndex].Type))
276
_context
.LogError(null, DiagnosticId.CustomAttributeArgumentForTypeRequiresNestedNode, "System.Object", "argument");
280
var typedef =
_context
.TryResolve(typeref);
303
var enumType =
_context
.Resolve(typeref);
317
var diagnosticContext = new DiagnosticContext(new MessageOrigin(provider), diagnosticsEnabled: true,
_context
);
318
if (!
_context
.TypeNameResolver.TryResolveTypeName(svalue, diagnosticContext, out TypeReference? type, out _, needsAssemblyName: false))
320
_context
.LogError(GetMessageOriginForPosition(nav), DiagnosticId.CouldNotResolveCustomAttributeTypeValue, svalue);
347
else if (arg.Type.IsSubclassOf(elementType.Namespace, elementType.Name,
_context
))
353
_context
.LogError(GetMessageOriginForPosition(nav), DiagnosticId.UnexpectedAttributeArgumentType, typeref.GetDisplayName());
366
_context
.LogError(GetMessageOriginForPosition(nav), DiagnosticId.UnexpectedAttributeArgumentType, typeref.GetDisplayName());
376
var diagnosticContext = new DiagnosticContext(new MessageOrigin(provider), diagnosticsEnabled: true,
_context
);
377
if (!
_context
.TypeNameResolver.TryResolveTypeName(typeName, diagnosticContext, out TypeReference? typeref, out _, needsAssemblyName: false))
379
_context
.LogError(GetMessageOriginForPosition(nav), DiagnosticId.TypeUsedWithAttributeValueCouldNotBeFound, typeName, nav.Value);
441
_context
.LogError(null, DiagnosticId.CannotConverValueToType, value.ToString() ?? "", targetType.GetDisplayName());
451
attributeType =
_context
.GetType(attributeFullName);
458
assembly =
_context
.TryResolve(AssemblyNameReference.Parse(assemblyName));
474
attributeType =
_context
.TryResolve(assembly, attributeFullName);
Linker.Steps\ProcessLinkerXmlBase.cs (8)
65
protected virtual bool ShouldProcessElement(XPathNavigator nav) => FeatureSettings.ShouldProcessElement(nav,
_context
, _xmlDocumentLocation);
83
_context
.Annotations.AddResourceToRemove(_resource.Value.Assembly, _resource.Value.Resource);
148
foreach (AssemblyDefinition assembly in
_context
.GetReferencedAssemblies())
154
AssemblyDefinition? assembly = assemblyToProcess ??
_context
.TryResolve(name!);
214
protected virtual TypeDefinition? ProcessExportedType(ExportedType exported, AssemblyDefinition assembly, XPathNavigator nav) =>
_context
.TryResolve(exported);
533
_context
.LogWarning(message, warningCode, GetMessageOriginForPosition(position));
538
_context
.LogWarning(GetMessageOriginForPosition(position), id, args);
644
_context
.TryResolve(target) is TypeDefinition typeDefinition &&