[RFC] Adding driver option to emit assembly from LTO


I want to propose adding driver option for emitting assembly from LTO stage.

I recently added a patch for doing so in LLVM gold linker plugin: https://reviews.llvm.org/D56114

I just thought that it might be convenient to have something like -flto-S or just -S that we can pass to the link command and have assembly output after LTO is done.

Right now -S option isn’t doing anything useful if all the inputs are object files.

We might need an earlier loop over the input files to determine that they are all object files and then override the final phase to be only linking. I understand that we might have issues supporting different linkers and LTO plugins but anyway just wanted to know what community thinks about that.

Best regards,
Denis Bakhvalov.