[lld] r187670 - Use report_fatal_error() instead of llvm_unreachable() to show broken input file error.
Rafael EspĂndola
rafael.espindola at gmail.com
Thu Aug 8 08:46:05 PDT 2013
>> We do use asserts when reading IR files, for example, check BitcodeReader.cpp:
>>
>> assert(Ty == V->getType() && "Type mismatch in constant table!");
>
> Presumably this should only fire for code that doesn't pass the
> verifier & no program using the LLVM APIs should generate such a
> program (if they do, that's a programming error on their part - the
> assertion is there to help them fix the bug, LLVM will not be
> resilient to such errors). User-provided IR goes through the verifier
> & gets nice pretty error messages, etc, rather than assertion
> failures.
I don't think so. I think this is just reading a .bc file, so before
any verifier pass is even possible, so yes, we can assert on an
corrupted .bc file. I think we should produce fatal errors, but the
point remain that anything reading a .bc file (including the linker
during LTO) cannot be assumed to have only non fatal errors.
Cheers,
Rafael
More information about the llvm-commits
mailing list