See: https://github.com/llvm/llvm-project/pull/171872#issuecomment-3716175811
Single-use AddEmitPasses is inlined into RunCodegenPipeline for clarity in comparing the parameters to the plugin and the parameters passed to addPassesToEmitFile. Pull Request: https://github.com/llvm/llvm-project/pull/171872