Method AddInternalizePassWithMustPreservePredicate
AddInternalizePassWithMustPreservePredicate<T>(T, Predicate<Value>)
Create and add the internalize pass to the given pass manager with the provided preservation callback.
Declaration
public static T AddInternalizePassWithMustPreservePredicate<T>([ValidatedNotNull] this T passManager, Predicate<Value> predicate)
where T : PassManager
Parameters
public static T AddInternalizePassWithMustPreservePredicate<T>([ValidatedNotNull] this T passManager, Predicate<Value> predicate)
where T : PassManager
T | passManager | PassManager to add the pass to |
Predicate<Value> | predicate | predicate to callback on each invocation |
Returns
T | The input |
Type Parameters
T | Type of PassManager |
Remarks
Any instance that predicate
is a member of (if not static) MUST outlive the
lifetime of passManager
or unpredictable results will occur (usually a crash).
This is especially important for disposable types as calling Dispose on them can invalidate the
predicate function.
Additionally, the predicate function MUST NOT throw, or allow any exceptions to bubble out of the function as it is called by native code that has no idea what to do with a managed code exception. (Again, likely resulting in a crash)