Clang provides the -mlink-bitcode-file and -mlink-builtin-bitcode
options to insert LLVM-IR into the current TU. These are usefuly
primarily for including LLVM-IR files that require special handling to
be correct and cannot be linked normally, such as GPU vendor libraries
like libdevice.10.bc. Currently these options can only be used if the
source input goes through the AST consumer path. This patch makes the
changes necessary to also support this when the input is LLVM-IR. This
will allow the following operation:
clang in.bc -Xclang -mlink-builtin-bitcode -Xclang libdevice.10.bc
I'm used to this sort of copy-some-args-and-not-others showing up in bug reports. Could this patch be re-ordered to make it apparent what functional changes are happening relative to the current head?