[cfe-dev] [RFC] A proposal for #pragma optnone

Chandler Carruth chandlerc at google.com
Mon Apr 28 10:44:12 PDT 2014


Setting aside the reasonable concerns over naming...

On Mon, Apr 28, 2014 at 6:06 AM, Dario Domizioli
<dario.domizioli at gmail.com>wrote:

> Proposals like this one have not received much attention in the past, but
> we are still keen to work with the community on this.


This doesn't seem accurate.

When the optnone stuff was first discussed, the use of a pragma *was*
discussed, and there were arguments against it because the semantics are
highly confusing: it only has effect on the function definitions which are
started after the pragma. This is confusing as you might start the pragma
*inside* a function definition. Such a pragma might even have semantic
impact by disabling optimizations within the body of lambda, but *not*
within any surrounding expressions.

Personally, I find the semantics of such a pragma extremely confusing. I
would never advocate the use of such a pragma, instead I would strongly
advocate *against* its use in literally all circumstances. It is hard to
support including it in Clang given that.

On the flip side, we have a function attribute which has a reasonable
semantic model and addresses the use case originally posited.

So I don't think that this is something which has been left unattended. I
think it was attended, and in the discussion that led to optnone, the
approach was not pursued and instead a different one was.
-Chandler
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140428/7ae8fbe9/attachment.html>


More information about the cfe-dev mailing list