47 references to TypePreserve
illink (47)
Linker.Steps\DescriptorMarker.cs (13)
57
if (GetTypePreserve (nav) ==
TypePreserve
.All) {
94
_context.Annotations.SetPreserve (type,
TypePreserve
.All);
113
TypePreserve
preserve = GetTypePreserve (nav);
115
case
TypePreserve
.Fields when !type.HasFields:
119
case
TypePreserve
.Methods when !type.HasMethods:
123
case
TypePreserve
.Fields:
124
case
TypePreserve
.Methods:
125
case
TypePreserve
.All:
148
protected static
TypePreserve
GetTypePreserve (XPathNavigator nav)
152
return nav.HasChildren ?
TypePreserve
.Nothing :
TypePreserve
.All;
154
if (Enum.TryParse (attribute, true, out
TypePreserve
result))
156
return
TypePreserve
.Nothing;
Linker.Steps\MarkStep.cs (6)
294
if (Annotations.TryGetPreserve (type, out
TypePreserve
preserve) && preserve ==
TypePreserve
.All)
2709
if (Annotations.TryGetPreserve (type, out
TypePreserve
preserve)) {
2716
case
TypePreserve
.All:
2721
case
TypePreserve
.Fields:
2725
case
TypePreserve
.Methods:
Linker.Steps\RootAssemblyInputStep.cs (1)
140
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)> ();
287
public bool SetAppliedPreserve (TypeDefinition type,
TypePreserve
preserve)
289
if (!preserved_types.TryGetValue (type, out (
TypePreserve
preserve, bool applied) existing))
305
public void SetPreserve (TypeDefinition type,
TypePreserve
preserve)
307
Debug.Assert (preserve !=
TypePreserve
.Nothing);
308
if (!preserved_types.TryGetValue (type, out (
TypePreserve
preserve, bool applied) existing)) {
316
Debug.Assert (existing.preserve !=
TypePreserve
.Nothing);
317
var
newPreserve = ChoosePreserveActionWhichPreservesTheMost (existing.preserve, preserve);
327
public static
TypePreserve
ChoosePreserveActionWhichPreservesTheMost (
TypePreserve
leftPreserveAction,
TypePreserve
rightPreserveAction)
332
if (leftPreserveAction ==
TypePreserve
.All || rightPreserveAction ==
TypePreserve
.All)
333
return
TypePreserve
.All;
335
if (leftPreserveAction ==
TypePreserve
.Nothing)
338
if (rightPreserveAction ==
TypePreserve
.Nothing)
341
if ((leftPreserveAction ==
TypePreserve
.Methods && rightPreserveAction ==
TypePreserve
.Fields) ||
342
(leftPreserveAction ==
TypePreserve
.Fields && rightPreserveAction ==
TypePreserve
.Methods))
343
return
TypePreserve
.All;
348
public bool TryGetPreserve (TypeDefinition type, out
TypePreserve
preserve)
350
if (preserved_types.TryGetValue (type, out (
TypePreserve
preserve, bool _applied) existing)) {
355
preserve = default (
TypePreserve
);
Linker\LinkerAttributesInformation.cs (2)
59
if (context.Annotations.TryGetPreserve (td, out
TypePreserve
preserve) && preserve !=
TypePreserve
.Nothing)