[PATCH] [DOC] Documentation for pragma optimize on/off

Aaron Ballman aaron at aaronballman.com
Fri May 23 08:50:52 PDT 2014


On Fri, May 23, 2014 at 11:48 AM, Aaron Ballman <aaron at aaronballman.com> wrote:
> On Fri, May 23, 2014 at 11:17 AM, Dario Domizioli
> <dario.domizioli at gmail.com> wrote:
>> Hi,
>>
>> Please find attached a documentation patch that details the Clang extensions
>> to selectively disable optimizations.
>>
>> I have noticed that attribute `optnone` was not documented from a user's
>> point of view, so I have documented it first in the same section. Then I
>> have described the recently submitted support for `#pragma clang optimize
>> on/off`.
>
> The optnone documentation should actually live in AttrDocs.td (and a
> slight change in Attr.td to hook the documentation up to the
> attribute).

Of course, I went and looked *after* I sent the email, but optnone is
documented.

def OptnoneDocs : Documentation {
  let Category = DocCatFunction;
  let Content = [{
The ``optnone`` attribute suppresses essentially all optimizations
on a function or method, regardless of the optimization level applied to
the compilation unit as a whole.  This is particularly useful when you
need to debug a particular function, but it is infeasible to build the
entire application without optimization.  Avoiding optimization on the
specified function can improve the quality of the debugging information
for that function.

This attribute is incompatible with the ``always_inline`` attribute.
  }];
}

However, we're currently experiencing difficulties with the
server-side process that converts this into live documentation, so
that documentation is not live yet. I've brought this up with the
server admin, and will continue to follow up until it's resolved.

~Aaron



More information about the cfe-commits mailing list