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)
302
if (Annotations.TryGetPreserve(type, out
TypePreserve
preserve) && preserve ==
TypePreserve
.All)
2929
if (Annotations.TryGetPreserve(type, out
TypePreserve
preserve))
2938
case
TypePreserve
.All:
2943
case
TypePreserve
.Fields:
2947
case
TypePreserve
.Methods:
Linker.Steps\RootAssemblyInputStep.cs (1)
145
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)>();
275
public bool SetAppliedPreserve(TypeDefinition type,
TypePreserve
preserve)
277
if (!preserved_types.TryGetValue(type, out (
TypePreserve
preserve, bool applied) existing))
294
public void SetPreserve(TypeDefinition type,
TypePreserve
preserve)
296
Debug.Assert(preserve !=
TypePreserve
.Nothing);
297
if (!preserved_types.TryGetValue(type, out (
TypePreserve
preserve, bool applied) existing))
307
Debug.Assert(existing.preserve !=
TypePreserve
.Nothing);
308
var
newPreserve = ChoosePreserveActionWhichPreservesTheMost(existing.preserve, preserve);
320
public static
TypePreserve
ChoosePreserveActionWhichPreservesTheMost(
TypePreserve
leftPreserveAction,
TypePreserve
rightPreserveAction)
325
if (leftPreserveAction ==
TypePreserve
.All || rightPreserveAction ==
TypePreserve
.All)
326
return
TypePreserve
.All;
328
if (leftPreserveAction ==
TypePreserve
.Nothing)
331
if (rightPreserveAction ==
TypePreserve
.Nothing)
334
if ((leftPreserveAction ==
TypePreserve
.Methods && rightPreserveAction ==
TypePreserve
.Fields) ||
335
(leftPreserveAction ==
TypePreserve
.Fields && rightPreserveAction ==
TypePreserve
.Methods))
336
return
TypePreserve
.All;
341
public bool TryGetPreserve(TypeDefinition type, out
TypePreserve
preserve)
343
if (preserved_types.TryGetValue(type, out (
TypePreserve
preserve, bool _applied) existing))
349
preserve = default(
TypePreserve
);
Linker\LinkerAttributesInformation.cs (2)
63
if (context.Annotations.TryGetPreserve(td, out
TypePreserve
preserve) && preserve !=
TypePreserve
.Nothing)