[cfe-dev] changing -save-temps to keep bitcode?

Bob Wilson bob.wilson at apple.com
Mon Dec 15 11:26:43 PST 2014


We spend a lot of time investigating clang bug reports, often with users who aren’t very comfortable working from a command line. One approach that often works well when we need to collect more information is to request that they build with -save-temps and then provide the resulting preprocessed source and assembly code. I’d like to extend that to also include the bitcode. That gives us a really easy way to collect the information we need to triage a bug report. It would also help identify issues where writing the bitcode to a file changes the results. That isn’t supposed to happen, and Duncan’s recent work to preserve the use-list order in the bitcode helps a lot, but I’m pretty sure there are still cases where it happens.

Does anyone have interest in this or objections to it?

The changes to implement it should be straightforward. The -save-temps option would cause the driver to run the cc1 phase with -emit-llvm, and then the driver would need a new “Backend” action to compile the bitcode file. The Backend action would be used only with the -save-temps option, in the same way that the existing Assemble action is treated when using the integrated assembler.



More information about the cfe-dev mailing list