[llvm-dev] Errorifying the bitcode reader

Pete Cooper via llvm-dev llvm-dev at lists.llvm.org
Mon Nov 7 13:37:45 PST 2016


BTW I tried to do this a while ago, but held off on the patches because of the ThinLTO work I didn’t want to interfere with.

The easiest way I could find to do it was to use Error internally, but stop at API boundaries.  So all the BitCodeReader methods used publicly would still be std::error_code.  That made for a manageable patch, then a follow on could propagate errors out of the API to the clients.

Of course feel free to convert this however you feel is right. Just wanted to give some insight having done this before.

Thanks,
Pete
> On Nov 7, 2016, at 1:35 PM, Mehdi Amini via llvm-dev <llvm-dev at lists.llvm.org> wrote:
> 
> Thanks Peter!
> (Both for the heads up and for doing this)
> 
>> Mehdi
> 
>> On Nov 7, 2016, at 1:32 PM, Peter Collingbourne <peter at pcc.me.uk> wrote:
>> 
>> Hi all,
>> 
>> Just a heads up that I'm working on Errorifying the bitcode reader. Basically any errors that are currently being reported with the DiagnosticHandler would now be reported with an Error instead.
>> 
>> It's turning out to be a rather large patch, but it should permit some much needed cleanups (e.g. not requiring an LLVMContext in some parts of the bitcode reader interface simply in order to provide a diagnostic handler) so I'm looking forward to the end result.
>> 
>> Thanks,
>> -- 
>> -- 
>> Peter
> 
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev



More information about the llvm-dev mailing list