[LLVMdev] [RFC] Add warning capabilities in LLVM.

Chris Lattner clattner at apple.com
Wed Jul 24 21:37:17 PDT 2013

On Jul 22, 2013, at 2:25 PM, Chandler Carruth <chandlerc at google.com> wrote:

> On Mon, Jul 22, 2013 at 2:21 PM, Eric Christopher <echristo at gmail.com> wrote:
> >> This is pretty much the same as what Quentin proposed (with the addition of the enum), isn't it?
> >>
> >
> > Pretty close yeah.
> >
> Another thought and alternate strategy for dealing with these sorts of things:
> A much more broad set of callback machinery that allows the backend to
> communicate values or other information back to the front end that can
> then decide what to do. We can define an interface around this, but
> instead of having the backend vending diagnostics we have the callback
> take a "do something with this value" which can just be "communicate
> it back to the front end" or a diagnostic callback can be passed down
> from the front end, etc.
> This will probably take a bit more design to get a general framework
> set up, but imagine the usefulness of say being able to automatically
> reschedule a jitted function to a thread with a larger default stack
> size if the callback states that the thread size was N+1 where N is
> the size of the stack for a thread you've created.
> FWIW, *this* is what I was trying to get across. Not that it wouldn't be a callback-based mechanism, but that it should be a fully general mechanism rather than having something to do with warnings, errors, notes, etc. If a frontend chooses to use it to produce such diagnostics, cool, but there are other use cases that the same machinery should serve.

How about this: keep the jist of the current API, but drop the "warning"- or "error"-ness of the API.  Instead, the backend just includes an enum value (plus string message for extra data).  The frontend makes the decision of how to render the diagnostic (or not, dropping them is fine) along with how to map them onto warning/error or whatever concepts they use.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130724/38518679/attachment.html>

More information about the llvm-dev mailing list