Linking LLVM bitcode from clang driver

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Linking LLVM bitcode from clang driver

Vassil Vassilev via cfe-dev
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:
clang -emit-llvm -c file1.cl file2.cl

Compile each input file to bitcode and link bitcodes together (this currently gives error):
clang -emit-llvm file1.cl file2.cl

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.

Nikolay


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev