[cfe-dev] [RfC] adding new outputs to -save-temps
Jorge Gorbe Moya via cfe-dev
cfe-dev at lists.llvm.org
Thu May 11 16:00:32 PDT 2017
I'm interested in adding two new outputs to -save-temps:
- Unoptimized .ll
- Optimized .ll
It's already possible to produce these outputs manually by invoking clang
several times with different flag combinations (-emit-llvm -S for optimized
-Xclang -disable-llvm-passes for unoptimized IR), but I think it would be
interesting to have these generated automatically by -save-temps as a
My current plan is to add two new actions in the driver whenever
specified, so that their outputs are preserved by -save-temps just like any
intermediate step. I have uploaded an initial patch at
but I have a couple of questions about it:
1. the new actions would have TY_LLVM_IR as their output type, which causes
error when building for multiple architectures because outputs of that type
cannot be lipo'd. I have no idea about lipo, is this some kind of
limitation or something that can be fixed or worked around?
2. The comment  right above the code that triggers that error says "we
remove this oddity by just changing the output names to include the arch",
looking at the multiarch save-temps tests  all the temporary files
seem to have arch suffixes in their names already. Is this comment outdated
am I interpreting it wrong?
All comments welcome.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cfe-dev