r225244 - Sema: analyze I,J,K,M,N,O constraints

Eric Christopher echristo at gmail.com
Thu Jan 15 10:07:33 PST 2015


On Thu Jan 15 2015 at 4:23:00 AM Joerg Sonnenberger <joerg at britannica.bec.de>
wrote:

> On Wed, Jan 14, 2015 at 02:44:44PM -0800, Reid Kleckner wrote:
> > This change simply allows us to reject bad code earlier in a more user
> > friendly way.
>
> How is it bad code or userfriendly? Have you looked at the inb example I
> posted? Forcing macros is stupid and with ToT it is outright impossible
> to produce optimal code. Yes, it depends on the optimizer to do a basic
> job, so what?
>
>
The problem is that if the argument to the function isn't actually constant
then the front end won't be able to diagnose it and at best it'll get
diagnosed in the back end or by the assembler. The idea is that the front
end handles these sorts of diagnostics and doesn't rely on optimization to
happen to get them. We do have some support for back end diagnostics using
front end locations - but I'm not sure we should use that here. Slippery
slope and all. FWIW this fired a few times in our internal code base and we
just fixed it up.

Quentin: You were in this area most recently, do you have any thoughts here?

-eric
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150115/e080cfd4/attachment.html>


More information about the cfe-commits mailing list