<div dir="ltr"><div>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:</div><div><br></div><div>Compile each input file to object:</div><div><div>clang -c <a href="http://file1.cl">file1.cl</a> <a href="http://file2.cl">file2.cl</a><br></div></div><div><br></div><div><div>Compile each input file to object and link objects together:</div><div></div></div><div><div>clang -c <a href="http://file1.cl">file1.cl</a> <a href="http://file2.cl">file2.cl</a><br></div></div><div><br></div><div>Compile each input file to bitcode:</div><div>clang -emit-llvm -c <a href="http://file1.cl">file1.cl</a> <a href="http://file2.cl">file2.cl</a></div><div><br></div><div>Compile each input file to bitcode and link bitcodes together (this currently gives error):</div><div><div>clang -emit-llvm <a href="http://file1.cl">file1.cl</a> <a href="http://file2.cl">file2.cl</a></div></div><div><br></div><div>Is there any interest in such feature? Any objections/additional considerations?</div><div><br></div><div>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.</div><div><br></div>Nikolay<div><br></div></div>