Currently the code-model does not get saved in the module IR, so if a code model is specified when compiling with LTO, it gets lost and is not propagated properly to LTO. This patch (along with one to the Clang front end: https://reviews.llvm.org/D52323) fixes that.
Depends on https://reviews.llvm.org/D52323
Fixes PR33306.
Is this the correct linking behaviour for code model? I.e., is it illegal to link two object files together that have different code models?