r194845 - Revert "Using an invalid -O falls back on -O3 instead of an error"

Alp Toker alp at nuanti.com
Sun Nov 17 02:18:51 PST 2013


On 17/11/2013 10:03, Sylvestre Ledru wrote:
> Hello Alp,
> On 16/11/2013 16:27, Alp Toker wrote:
>> On 16/11/2013 09:25, Sylvestre Ledru wrote:
>>> On 15/11/2013 21:40, Alp Toker wrote:
>>>> Author: alp
>>>> Date: Fri Nov 15 14:40:58 2013
>>>> New Revision: 194845
>>>>
>>>> URL: http://llvm.org/viewvc/llvm-project?rev=194845&view=rev
>>>> Log:
>>>> Revert "Using an invalid -O falls back on -O3 instead of an error"
>>>>
>>>> Trying to fix test failures since earlier today.
>>>>
>>>> One of the tests added in this commit is outputting
>>>> test/Driver/clang_f_opts.s
>>>> which the builders that build in-tree (eg.
>>>> clang-native-arm-cortex-a9) are
>>>> trying to run as a test case, causing failures.
>>>>
>>>> clang_f_opts.c:
>>>>     If -### doesn't emit the warning then this test probably
>>>> shouldn't be in
>>>>     here in the first place. Frontend maybe?
>>>>
>>> Do you have an idea on how to fix that ?
>> Hello Sylvestre,
>>
>> It's down to the spit between driver and frontend in clang.
>>
>> Although this is a simplification, the driver is a top-level
>> executable that invokes other tools including clang -cc1. Both are the
>> same binary in practice.
>>
>> clang -### will never invoke clang -cc1, instead only running the
>> driver's command-line processing.
>>
>> I don't know the full history of the patch you were working on. It'll
>> be helpful if you can mention why the new fallback from higher -O
>> numbers wasn't added in the same place as the existing -04/-03 logic.
> I just updated the existing code to manage it as a warning instead of an
> error. I was trying to keep the changes minimal.
>
> So, if I move it to the driver, it should (hopefully) fix the problem,
> isn't it ?

Yes. Implementing this in the driver alongside or replacing the existing 
04/03 special case and will solve the problem.

The error handling in the frontend should remain strict as part of the 
'native' command-line options.

PS. I've suppressed %clang_cc1 availability under test/Driver in r194919 
to help catch problems like this earlier.

Alp.


>
> Thanks,
> Sylvestre

-- 
http://www.nuanti.com
the browser experts




More information about the cfe-commits mailing list