47 references to TypePreserve
illink (47)
Linker.Steps\DescriptorMarker.cs (13)
57
if (GetTypePreserve(nav) ==
TypePreserve
.All)
100
_context.Annotations.SetPreserve(type,
TypePreserve
.All);
133
TypePreserve
preserve = GetTypePreserve(nav);
136
case
TypePreserve
.Fields when !type.HasFields:
140
case
TypePreserve
.Methods when !type.HasMethods:
144
case
TypePreserve
.Fields:
145
case
TypePreserve
.Methods:
146
case
TypePreserve
.All:
171
protected static
TypePreserve
GetTypePreserve(XPathNavigator nav)
175
return nav.HasChildren ?
TypePreserve
.Nothing :
TypePreserve
.All;
177
if (Enum.TryParse(attribute, true, out
TypePreserve
result))
179
return
TypePreserve
.Nothing;
Linker.Steps\MarkStep.cs (6)
314
if (Annotations.TryGetPreserve(type, out
TypePreserve
preserve) && preserve ==
TypePreserve
.All)
2963
if (Annotations.TryGetPreserve(type, out
TypePreserve
preserve))
2972
case
TypePreserve
.All:
2977
case
TypePreserve
.Fields:
2981
case
TypePreserve
.Methods:
Linker.Steps\RootAssemblyInputStep.cs (1)
146
Annotations.SetPreserve(type,
TypePreserve
.All);
Linker\Annotations.cs (25)
57
protected readonly Dictionary<TypeDefinition, (
TypePreserve
preserve, bool applied)> preserved_types = new Dictionary<TypeDefinition, (
TypePreserve
, bool)>();
276
public bool SetAppliedPreserve(TypeDefinition type,
TypePreserve
preserve)
278
if (!preserved_types.TryGetValue(type, out (
TypePreserve
preserve, bool applied) existing))
295
public void SetPreserve(TypeDefinition type,
TypePreserve
preserve)
297
Debug.Assert(preserve !=
TypePreserve
.Nothing);
298
if (!preserved_types.TryGetValue(type, out (
TypePreserve
preserve, bool applied) existing))
308
Debug.Assert(existing.preserve !=
TypePreserve
.Nothing);
309
var
newPreserve = ChoosePreserveActionWhichPreservesTheMost(existing.preserve, preserve);
321
public static
TypePreserve
ChoosePreserveActionWhichPreservesTheMost(
TypePreserve
leftPreserveAction,
TypePreserve
rightPreserveAction)
326
if (leftPreserveAction ==
TypePreserve
.All || rightPreserveAction ==
TypePreserve
.All)
327
return
TypePreserve
.All;
329
if (leftPreserveAction ==
TypePreserve
.Nothing)
332
if (rightPreserveAction ==
TypePreserve
.Nothing)
335
if ((leftPreserveAction ==
TypePreserve
.Methods && rightPreserveAction ==
TypePreserve
.Fields) ||
336
(leftPreserveAction ==
TypePreserve
.Fields && rightPreserveAction ==
TypePreserve
.Methods))
337
return
TypePreserve
.All;
342
public bool TryGetPreserve(TypeDefinition type, out
TypePreserve
preserve)
344
if (preserved_types.TryGetValue(type, out (
TypePreserve
preserve, bool _applied) existing))
350
preserve = default(
TypePreserve
);
Linker\LinkerAttributesInformation.cs (2)
63
if (context.Annotations.TryGetPreserve(td, out
TypePreserve
preserve) && preserve !=
TypePreserve
.Nothing)