Carter, Jack
2012-Jun-22 01:12 UTC
[LLVMdev] How to generate a non-fatal error from the backend
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. Thanks, Jack -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120622/42dcca3f/attachment.html>
Eli Friedman
2012-Jun-22 01:27 UTC
[LLVMdev] How to generate a non-fatal error from the backend
On Thu, Jun 21, 2012 at 6: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.Can you give a bit more context? The way LLVM handles errors varies a lot depending on what you're doing. -Eli
Justin Holewinski
2012-Jun-22 01:35 UTC
[LLVMdev] How to generate a non-fatal error from the backend
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>
Seemingly Similar Threads
- [LLVMdev] [llvm-commits] [PATCH] Allow per-thread re-direction of outs()/errs()
- [LLVMdev] [llvm-commits] [PATCH] Allow per-thread re-direction of outs()/errs()
- [LLVMdev] [llvm-commits] [PATCH] Allow per-thread re-direction of outs()/errs()
- [LLVMdev] [llvm-commits] [PATCH] Allow per-thread re-direction of outs()/errs()
- [RFC] New diagnostic handler for llc