<div dir="ltr"><div>Hi,</div><div><br></div><div>I'm interested in adding two new outputs to -save-temps:</div><div><br></div><div>- Unoptimized .ll</div><div>- Optimized .ll</div><div><br></div><div>It's already possible to produce these outputs manually by invoking clang</div><div>several times with different flag combinations (-emit-llvm -S for optimized IR, add</div><div>-Xclang -disable-llvm-passes for unoptimized IR), but I think it would be</div><div>interesting to have these generated automatically by -save-temps as a debugging</div><div>aid.</div><div><br></div><div>My current plan is to add two new actions in the driver whenever -save-temps is</div><div>specified, so that their outputs are preserved by -save-temps just like any other</div><div>intermediate step. I have uploaded an initial patch at <a href="https://reviews.llvm.org/D33108">https://reviews.llvm.org/D33108</a>,</div><div>but I have a couple of questions about it:</div><div><br></div><div>1. the new actions would have TY_LLVM_IR as their output type, which causes an</div><div>error when building for multiple architectures because outputs of that type</div><div>cannot be lipo'd. I have no idea about lipo, is this some kind of fundamental</div><div>limitation or something that can be fixed or worked around?</div><div><br></div><div>2.  The comment [0] right above the code that triggers that error says "we could</div><div>remove this oddity by just changing the output names to include the arch", but</div><div>looking at the multiarch save-temps tests [1] all the temporary files produced</div><div>seem to have arch suffixes in their names already. Is this comment outdated or</div><div>am I interpreting it wrong?</div><div><br></div><div>All comments welcome.</div><div><br></div><div>Thanks,</div><div>Jorge</div><div><br></div><div>[0] <a href="https://github.com/llvm-mirror/clang/blob/master/lib/Driver/Driver.cpp#L1390-L1394">https://github.com/llvm-mirror/clang/blob/master/lib/Driver/Driver.cpp#L1390-L1394</a></div><div>[1] <a href="https://github.com/llvm-mirror/clang/blob/master/test/Driver/save-temps.c#L30-L43">https://github.com/llvm-mirror/clang/blob/master/test/Driver/save-temps.c#L30-L43</a></div><div><br></div><div><br></div></div>