47 references to TypePreserve
illink (47)
Linker.Steps\DescriptorMarker.cs (13)
57
if (GetTypePreserve (nav) ==
TypePreserve
.All) {
94
_context.Annotations.SetPreserve (type,
TypePreserve
.All);
125
TypePreserve
preserve = GetTypePreserve (nav);
127
case
TypePreserve
.Fields when !type.HasFields:
131
case
TypePreserve
.Methods when !type.HasMethods:
135
case
TypePreserve
.Fields:
136
case
TypePreserve
.Methods:
137
case
TypePreserve
.All:
160
protected static
TypePreserve
GetTypePreserve (XPathNavigator nav)
164
return nav.HasChildren ?
TypePreserve
.Nothing :
TypePreserve
.All;
166
if (Enum.TryParse (attribute, true, out
TypePreserve
result))
168
return
TypePreserve
.Nothing;
Linker.Steps\MarkStep.cs (6)
294
if (Annotations.TryGetPreserve (type, out
TypePreserve
preserve) && preserve ==
TypePreserve
.All)
2704
if (Annotations.TryGetPreserve (type, out
TypePreserve
preserve)) {
2711
case
TypePreserve
.All:
2716
case
TypePreserve
.Fields:
2720
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)> ();
272
public bool SetAppliedPreserve (TypeDefinition type,
TypePreserve
preserve)
274
if (!preserved_types.TryGetValue (type, out (
TypePreserve
preserve, bool applied) existing))
290
public void SetPreserve (TypeDefinition type,
TypePreserve
preserve)
292
Debug.Assert (preserve !=
TypePreserve
.Nothing);
293
if (!preserved_types.TryGetValue (type, out (
TypePreserve
preserve, bool applied) existing)) {
301
Debug.Assert (existing.preserve !=
TypePreserve
.Nothing);
302
var
newPreserve = ChoosePreserveActionWhichPreservesTheMost (existing.preserve, preserve);
312
public static
TypePreserve
ChoosePreserveActionWhichPreservesTheMost (
TypePreserve
leftPreserveAction,
TypePreserve
rightPreserveAction)
317
if (leftPreserveAction ==
TypePreserve
.All || rightPreserveAction ==
TypePreserve
.All)
318
return
TypePreserve
.All;
320
if (leftPreserveAction ==
TypePreserve
.Nothing)
323
if (rightPreserveAction ==
TypePreserve
.Nothing)
326
if ((leftPreserveAction ==
TypePreserve
.Methods && rightPreserveAction ==
TypePreserve
.Fields) ||
327
(leftPreserveAction ==
TypePreserve
.Fields && rightPreserveAction ==
TypePreserve
.Methods))
328
return
TypePreserve
.All;
333
public bool TryGetPreserve (TypeDefinition type, out
TypePreserve
preserve)
335
if (preserved_types.TryGetValue (type, out (
TypePreserve
preserve, bool _applied) existing)) {
340
preserve = default (
TypePreserve
);
Linker\LinkerAttributesInformation.cs (2)
59
if (context.Annotations.TryGetPreserve (td, out
TypePreserve
preserve) && preserve !=
TypePreserve
.Nothing)