[lld] r187670 - Use report_fatal_error() instead of llvm_unreachable() to show broken input file error.

Rafael Espíndola rafael.espindola at gmail.com
Fri Aug 2 14:13:41 PDT 2013


> This really should return an error_code.  When lld is a library inside an app like an IDE, we don’t want to kill the whole app because of a malformed object file.

No opinion about this particular error, but do we really want to use
lld like that? As far as I can tell clang is not used like that. IDEs
(and all build systems really) just for exec clang. Given that there
are a lot more compile jobs than link jobs (and the clang driver forks
to run clang -cc1), it is not clear that the savings for not doing a
fork+exec for the linker would be noticeable.

Second, http://llvm.org/docs/CodingStandards.html#assert-liberally has
been in effect since forever, so even if all of lld and lib/Object are
"perfect", the IDE would still have to fork+exec when doing LTO, since
it seems almost impossible to change all of the middle end passes and
code generators to avoid assert, llvm_unreachable and
report_fatal_error.

> -Nick

Cheers,
Rafael




More information about the llvm-commits mailing list