Revert r365860 for PR42966 (with a tweak to the test case for r365862)
> Author: maskray
> Date: Thu Jul 11 19:01:51 2019
> New Revision: 365860
>
> URL: http://llvm.org/viewvc/llvm-project?rev=365860&view=rev
> Log:
> [Driver] Refactor interaction between -f(no-)?omit-frame-pointer and -m(no-)?omit-leaf-frame-pointer
>
> Use a tri-state enum to represent shouldUseFramePointer() and
> shouldUseLeafFramePointer().
>
> This simplifies the logic and fixes PR9825:
> -fno-omit-frame-pointer doesn't imply -mno-omit-leaf-frame-pointer.
>
> and PR24003:
> /Oy- /O2 should not omit leaf frame pointer: this matches MSVC x86-32.
> (/Oy- is a no-op on MSVC x86-64.)
>
> and:
> when CC1 option -mdisable-fp-elim if absent, -momit-leaf-frame-pointer
> can also be omitted.
>
> The new behavior matches GCC:
> -fomit-frame-pointer wins over -mno-omit-leaf-frame-pointer
> -fno-omit-frame-pointer loses out to -momit-leaf-frame-pointer
>
> The behavior makes lots of sense. We have 4 states:
>
> - 00) leaf retained, non-leaf retained
> - 01) leaf retained, non-leaf omitted (this is invalid)
> - 10) leaf omitted, non-leaf retained (what -momit-leaf-frame-pointer was designed for)
> - 11) leaf omitted, non-leaf omitted
>
> "omit" options taking precedence over "no-omit" options is the only way
> to make 3 valid states representable with -f(no-)?omit-frame-pointer and
> -m(no-)?omit-leaf-pointer.
>
> Reviewed By: ychen
>
> Differential Revision: https://reviews.llvm.org/D64294
git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_90@369333
91177308-0d34-0410-b5e6-
96231b3b80d8