]> granicus.if.org Git - clang/commit
Revert r365860 for PR42966 (with a tweak to the test case for r365862)
authorHans Wennborg <hans@hanshq.net>
Tue, 20 Aug 2019 07:21:14 +0000 (07:21 +0000)
committerHans Wennborg <hans@hanshq.net>
Tue, 20 Aug 2019 07:21:14 +0000 (07:21 +0000)
commitbe6ed962cfe0cc61250a514e2c98feb4e08d45ad
tree6cf84040ed78e19ab984794c41b5dd8c10a4423a
parentd7ef7e7c58f602a2b3a99ec4b27f9173d4e5bba3
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
lib/Driver/ToolChains/Clang.cpp
test/Driver/cl-options.c
test/Driver/clang_f_opts.c
test/Driver/frame-pointer-elim.c
test/Driver/xcore-opts.c