[LLVMdev] Error handling in LLVMObject library

Rafael EspĂ­ndola rafael.espindola at gmail.com
Mon Jun 1 11:56:29 PDT 2015


>> IMHO the most important thing is to make sure that every error path
>> you add is tested. With tests we can refactor. For example, see the
>> refactoring in (r238024).
>
>
> This revision uses report_fatal_error() instead of returning the error code.
> The only benefit of this
> is providing a reasonable error message, but this limits the ability to use
> LLVMObject as a library
> for parsing/querying invalid object files.

It is better than the undefined behavior that preceded the
report_fatal_error, but it can be improved and now with a test to make
sure the new error handling code is working.

Cheers,
Rafael



More information about the llvm-dev mailing list