[LTO] Fix lto_module_create_in_codegen_context return value on error
authorSteven Wu <stevenwu@apple.com>
Wed, 26 Oct 2022 22:13:00 +0000 (15:13 -0700)
committerSteven Wu <stevenwu@apple.com>
Wed, 26 Oct 2022 22:13:22 +0000 (15:13 -0700)
commit76ebaf263b20619b3416fbaa715fea25735bfe30
treed51d926812478dbc9822f4799a52f074390cc8a4
parent14275501516fe6ca896a0428ab8e5e0dc7bff137
[LTO] Fix lto_module_create_in_codegen_context return value on error

According to the documentation, lto_module_create_in_codegen_context
should return NULL on error but currently it is accidentally return
error_code. Since this is a bug fix and it seems to be a one-off bug
that only affects this API, there is no need to bump API version.

rdar://101505192

Reviewed By: pete

Differential Revision: https://reviews.llvm.org/D136769
llvm/tools/lto/lto.cpp