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.