[PATCH] D29475: [LTO] Add ability to emit assembly to new LTO API
Mehdi AMINI via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 2 15:54:20 PST 2017
mehdi_amini added a comment.
In https://reviews.llvm.org/D29475#665360, @tobiasvk wrote:
> In https://reviews.llvm.org/D29475#665351, @mehdi_amini wrote:
> > Can you clarify how one would implement `-save-temps` in a linker this way?
> Set Conf.CGFileType to CGFT_Assembly, then run an external assembler on all outputs produced by LTO before linking. We leave the output files around and output a notice to the user about their location. This is what we've been doing with the legacy API, and we'd like to keep it as we move to the new API.
That'd require to have a `driver` to run the external assembler in the linker, which isn't very common right? Otherwise the build system would need to know about this, which is also a non-trivial integration. I guess an assembler does not need much setup in terms of flags to pass, but still it is not clear to me if we'd be able to get the same binary in the end. That'd seem quite "fragile" to me.
However for the LLVM side of it, the patch seems non-intrusive enough that it is fine to me.
@pcc, any objection?
More information about the llvm-commits