r229575 - clang-cl: Disable frame pointer elimination at -O0

Nico Weber via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 19 18:10:20 PDT 2018


The generic O flag handling doesn't support 0 either. Would you be ok with
removing this?

Does /Od do what you want?

On Wed, Sep 19, 2018 at 4:52 PM Reid Kleckner <reid.kleckner at gmail.com>
wrote:

> I was probably using it myself, and was surprised that /O0 and -O0 had
> different behavior, because -O0 will hit the special O0 flag that disables
> FPO, but /O0 will hit the generic 'O' flag handling.
>
> On Wed, Sep 19, 2018 at 7:10 AM Nico Weber <thakis at chromium.org> wrote:
>
>> Do you remember why you landed this? cl.exe doesn't support /O0; why does
>> clang-cl?
>>
>> On Tue, Feb 17, 2015 at 5:53 PM Reid Kleckner <reid at kleckner.net> wrote:
>>
>>> Author: rnk
>>> Date: Tue Feb 17 16:40:42 2015
>>> New Revision: 229575
>>>
>>> URL: http://llvm.org/viewvc/llvm-project?rev=229575&view=rev
>>> Log:
>>> clang-cl: Disable frame pointer elimination at -O0
>>>
>>> This wasn't kicking in because the _SLASH_O flag didn't match our check
>>> for OPT_O0. Add an alias that does to keep the logic simple.
>>>
>>> Modified:
>>>     cfe/trunk/include/clang/Driver/CLCompatOptions.td
>>>
>>> Modified: cfe/trunk/include/clang/Driver/CLCompatOptions.td
>>> URL:
>>> http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/CLCompatOptions.td?rev=229575&r1=229574&r2=229575&view=diff
>>>
>>> ==============================================================================
>>> --- cfe/trunk/include/clang/Driver/CLCompatOptions.td (original)
>>> +++ cfe/trunk/include/clang/Driver/CLCompatOptions.td Tue Feb 17
>>> 16:40:42 2015
>>> @@ -80,6 +80,7 @@ def _SLASH_I : CLJoinedOrSeparate<"I">,
>>>    Alias<I>;
>>>  def _SLASH_J : CLFlag<"J">, HelpText<"Make char type unsigned">,
>>>    Alias<funsigned_char>;
>>> +def _SLASH_O0 : CLFlag<"O0">, Alias<O0>;
>>>  def _SLASH_O : CLJoined<"O">, HelpText<"Optimization level">,
>>>    MetaVarName<"<n>">, Alias<O>;
>>>  def _SLASH_Ob0 : CLFlag<"Ob0">, HelpText<"Disable inlining">,
>>>
>>>
>>> _______________________________________________
>>> cfe-commits mailing list
>>> cfe-commits at cs.uiuc.edu
>>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180919/a8425910/attachment.html>


More information about the cfe-commits mailing list