clang: Don't warn on unused momit-leaf-frame-pointer when frame pointers are off.
authorNico Weber <nicolasweber@gmx.de>
Tue, 13 Aug 2019 17:37:09 +0000 (17:37 +0000)
committerNico Weber <nicolasweber@gmx.de>
Tue, 13 Aug 2019 17:37:09 +0000 (17:37 +0000)
commit2346b92f2bff05ef9d83706787bd38e32e0079c5
treeadd08375491d424b3609e62e43b487ae6581564f
parent64517a6419ca7f7b4f349f512c7cc65c30dae2bf
clang: Don't warn on unused momit-leaf-frame-pointer when frame pointers are off.

This fixes a regression from r365860: As that commit message
states, there are 3 valid states targeted by the combination of
-f(no-)omit-frame-pointer and -m(no-)omit-leaf-frame-pointer.

After r365860 it's impossible to get from state 10 (omit just
leaf frame pointers) to state 11 (omit all frame pointers)
in a single command line without getting a warning.

This change restores that functionality.

Fixes PR42966.

Differential Revision: https://reviews.llvm.org/D66142

llvm-svn: 368728
clang/lib/Driver/ToolChains/Clang.cpp
clang/test/Driver/frame-pointer-elim.c