We currently depend on a patched version of LLVM to work around a feature/limitation/bug of LLVM's linker. It seems unlikely that the patch will make it into LLVM, so we should implement a workaround.
The problem is that function call arguments may have different types to the called functions. We should implement a wrapper for the IRBuilder CreateCall() function that adds bitcasts to arguments as appropriate and use that consistently for codegen.
I implemented a version of this as part of the larger
IMPALA-3066, but we could separate this out.