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

Alex Rosenberg alexr at leftfield.org
Wed Apr 30 22:35:04 PDT 2014


On Apr 30, 2014, at 4:10 AM, Dario Domizioli <dario.domizioli at gmail.com> wrote:
> 
> 
> 
>> On 30 April 2014 09:18, Renato Golin <renato.golin at linaro.org> wrote:
>> On 29 April 2014 23:49, Robinson, Paul
>> <Paul_Robinson at playstation.sony.com> wrote:
>> > Which cycles us back to the original proposal:
>> >
>> > #pragma clang optnone [on|off]
>> >
>> > ...which is obviously tied to the attribute of the same name, which
>> > seems like at least a small goodness.
>> 
>> Right, I think my list of arguments has ended. This seems as good as any.
> 
> Ok... so do we now have a consensus on the original spec?
>     #pragma clang optnone on
>     // code decorated with optnone
>     #pragma clang optnone off

FWIW, I find the double negative confusing to expose to users (although sensible in the IR). I'd spell it #pragma clang optimize on|off. This also allows expansion space for more fine-grained control if we ever go down that dark path.

Alex, bikeshed painter.

> It looks like you're convinced. Anybody else opposing this?
> 
> Anyway, I will try to make the implementation have a (thin) layer of API (something handling the "apply optnone to this function if possible" functionality) so that we can then use it in the future for the GCC or MSVC syntax if we want to.
> I will also have a look at similar pragmas like the one Reid mentioned ("#pragma data_seg") for inspiration, and hopefully we'll have some patches coming soon.
> 
>  
>> Just please, keep any new pragmas inside the Clang namespace and it
>> should be fine.
> 
> Yes, at this point it's clear it will have to be in the clang namespace.
> 
> Cheers,
>     Dario Domizioli
>     SN Systems - Sony Computer Entertainment Group
> 
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140430/39c63ae7/attachment.html>


More information about the cfe-dev mailing list