Currently, -emit-llvm can only be used when compiling (-c) and not when linking. I think such feature would be useful. I also think it would nicely corresponds to existing functionality:
Compile each input file to object:
Compile each input file to object and link objects together:
Compile each input file to bitcode and link bitcodes together (this currently gives error):
Is there any interest in such feature? Any objections/additional considerations?
Some background: we are trying to use Clang driver API to compile OpenCL to bitcode. This is easy to do for one source, however for multiple source files, there currently has to be a call for each source and then llvm-link to link them together (invoked separately from Clang driver API). Unifying this workflow would be good.