private static ITypeRewriter CreateTypeRewriter
        (
            AssemblyDefinition mscorlib,
            TypeDefinition bindingsBaseType,
            bool useDllImport
        )
        {
            var methodProcessors = new IMethodProcessor[]
            {
                new ParameterProcessor(mscorlib, bindingsBaseType),
                new NativeCallProcessor(useDllImport),
                new ReturnTypeProcessor(mscorlib),
            };

            if (Options.EnableDebugCalls)
            {
                methodProcessors = methodProcessors.Prepend(new DebugPrologueProcessor(mscorlib)).ToArray();
            }

            var methodRewriter = new MethodRewriter(methodProcessors);

            return(new TypeRewriter(mscorlib, useDllImport, methodRewriter));
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="MethodProcessorWithEpilogue{T}"/> class with a
 /// <see cref="EpilogueProcessor{T}"/> instance that will be used for epilogue processing.
 /// </summary>
 /// <param name="epilogueProcessor">
 /// The epilogue processor instance that will be used for epilogue processing.
 /// </param>
 public MethodProcessorWithEpilogue(EpilogueProcessor <T> epilogueProcessor)
 {
     PostProcessor = epilogueProcessor;
 }