/// <summary> /// Adds the given <paramref name="component"/> to the IL emission pipeline. /// </summary> /// <param name="editor"></param> /// <param name="component"></param> public static void EditIL(this CompilationEditor editor, AlternateEmitDelegate component) { editor.EditIL(CodeGeneratorContext.ToComponent(component)); }
/// <summary> /// Registers a new <paramref name="edit"/> that is to be applied to all operations /// that are about to be emitted. /// </summary> /// <param name="editor"></param> /// <param name="edit"></param> public static void EditOperation(this CompilationEditor editor, Edit <IOperation> edit) { editor.EditIL(next => (context, operation, used) => next(context, edit(operation, default(CancellationToken)), used)); }