[LLVMdev] How to generate a non-fatal error from the backend

Justin Holewinski justin.holewinski at gmail.com
Thu Jun 21 18:35:02 PDT 2012


On Thu, Jun 21, 2012 at 9:12 PM, Carter, Jack <jcarter at mips.com> wrote:

>  There are times that I want to generate an ERROR, but not stop
> processing of the code. An example of this would be when I find there is a
> value out of range for a specific operand.
>
> producing the error for all instances of this class of errors would be
> good.
>
> Also, I would like to have the error message have some relationship to the
> offending source.
>

This is something I've been looking into lately.  Currently, you can use
LLVMContext::emitError to send an error message to a registered error
handler (see LLVMContext::setInlineAsmDiagnosticHandler).  The handler can
write the message to a log file, console, etc..

I want to extend this to support error/warning/info messages, and also
associate source information if available.


>
> Thanks,
>
> Jack
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
>


-- 

Thanks,

Justin Holewinski
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120621/c347d3c9/attachment.html>


More information about the llvm-dev mailing list