also don't submit code to LLVM when the session has errors
Please read the rustc-dev-guide chapter on Backend Agnostic Codegen.