48 references to TypePreserve
illink (48)
Linker.Steps\DescriptorMarker.cs (14)
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:
162
if (preserve is
TypePreserve
.Nothing)
179
protected static
TypePreserve
GetTypePreserve(XPathNavigator nav)
183
return nav.HasChildren ?
TypePreserve
.Nothing :
TypePreserve
.All;
185
if (Enum.TryParse(attribute, true, out
TypePreserve
result))
187
return
TypePreserve
.Nothing;
Linker.Steps\MarkStep.cs (6)
321
if (Annotations.TryGetPreserve(type, out
TypePreserve
preserve) && preserve ==
TypePreserve
.All)
3044
if (Annotations.TryGetPreserve(type, out
TypePreserve
preserve))
3053
case
TypePreserve
.All:
3058
case
TypePreserve
.Fields:
3062
case
TypePreserve
.Methods:
Linker.Steps\RootAssemblyInputStep.cs (1)
144
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)>();
319
public bool SetAppliedPreserve(TypeDefinition type,
TypePreserve
preserve)
321
if (!preserved_types.TryGetValue(type, out (
TypePreserve
preserve, bool applied) existing))
338
public void SetPreserve(TypeDefinition type,
TypePreserve
preserve)
340
Debug.Assert(preserve !=
TypePreserve
.Nothing);
341
if (!preserved_types.TryGetValue(type, out (
TypePreserve
preserve, bool applied) existing))
351
Debug.Assert(existing.preserve !=
TypePreserve
.Nothing);
352
var
newPreserve = ChoosePreserveActionWhichPreservesTheMost(existing.preserve, preserve);
364
public static
TypePreserve
ChoosePreserveActionWhichPreservesTheMost(
TypePreserve
leftPreserveAction,
TypePreserve
rightPreserveAction)
369
if (leftPreserveAction ==
TypePreserve
.All || rightPreserveAction ==
TypePreserve
.All)
370
return
TypePreserve
.All;
372
if (leftPreserveAction ==
TypePreserve
.Nothing)
375
if (rightPreserveAction ==
TypePreserve
.Nothing)
378
if ((leftPreserveAction ==
TypePreserve
.Methods && rightPreserveAction ==
TypePreserve
.Fields) ||
379
(leftPreserveAction ==
TypePreserve
.Fields && rightPreserveAction ==
TypePreserve
.Methods))
380
return
TypePreserve
.All;
385
public bool TryGetPreserve(TypeDefinition type, out
TypePreserve
preserve)
387
if (preserved_types.TryGetValue(type, out (
TypePreserve
preserve, bool _applied) existing))
393
preserve = default(
TypePreserve
);
Linker\LinkerAttributesInformation.cs (2)
63
if (context.Annotations.TryGetPreserve(td, out
TypePreserve
preserve) && preserve !=
TypePreserve
.Nothing)