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

Chandler Carruth chandlerc at google.com
Tue Jul 16 17:57:59 PDT 2013


On Tue, Jul 16, 2013 at 5:51 PM, Eli Friedman <eli.friedman at gmail.com>wrote:

> > 1. Decide whether or not we want such capabilities (if we do not we may
> just
> > add sporadically the support for a new warning/group of warning/error).
> > 2. Come up with a plan to implement that (assuming we want it).
>
> The frontend should be presenting warnings, not the backend; adding a
> hook which provides the appropriate information shouldn't be too hard.
>  Warnings coming out of the backend are very difficult to design well,
> so I don't expect we will add many.  Also, keep in mind that the
> information coming out of the backend could be used in other ways; it
> might not make sense for the backend to decide that some piece of
> information should be presented as a warning.  (Consider, for example,
> IDE integration to provide additional information about functions and
> loops on demand.)
>
> -Eli


I really like this design, where essentially the frontend can query the
backend for very simple information using a nice API, and then emit the
warning itself. I'm happy for the warning to be in the CodeGen layer of the
frontend, and only be reachable when generating code for that function body.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130716/834d697d/attachment.html>


More information about the llvm-dev mailing list