<div dir="ltr"><div>Hi,</div><div><br></div><div>Please review the attached patch for adding "pragma clang optimize on/off" to clang.</div><div>This pragma is implemented by decorating function definitions in the "off" regions with attribute 'optnone'.</div>
<div><br></div><div>The syntax and semantics have been discussed in here:</div><div><a href="http://lists.cs.uiuc.edu/pipermail/cfe-dev/2014-April/036561.html">http://lists.cs.uiuc.edu/pipermail/cfe-dev/2014-April/036561.html</a><br>
</div><div>The final consensus was that the feature was worth having, and after a while I think we converged on the syntax, so I am now sending the patch for review.</div><div><br></div><div>Here is a very short summary of how the pragma works:</div>
<div><br></div><div>    // The default status is "on".</div><div>#pragma clang optimize off</div><div>    // Function definitions in here are decorated with attribute 'optnone' </div><div>    // but only if it does not conflict with existing attributes.</div>
<div>#pragma clang optimize on</div><div>    // Code compiled as normal.</div><div><br></div><div>The test provided with the patch checks a number of interesting cases, including template definitions and instantiations, macros, and conflicting attributes (e.g. always_inline).</div>
<div><br></div><div>I will prepare another patch for the documentation.</div><div><br></div><div>Cheers,</div><div>    Dario Domizioli</div><div>    SN Systems - Sony Computer Entertainment Group</div><div><br></div><div>
<br></div></div>