Commit Graph

14 Commits

Author SHA1 Message Date
Yuanfang Chen ff22ec3d70 [Clang] Replace cc1 options '-mdisable-fp-elim' and '-momit-leaf-frame-pointer'
with '-mframe-pointer'

After D56351 and D64294, frame pointer handling is migrated to tri-state
(all, non-leaf, none) in clang driver and on the function attribute.
This patch makes the frame pointer handling cc1 option tri-state.

Reviewers: chandlerc, rnk, t.p.northover, MaskRay

Reviewed By: MaskRay

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

llvm-svn: 366645
2019-07-20 22:50:50 +00:00
Fangrui Song dc0396614f [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

llvm-svn: 365860
2019-07-12 02:01:51 +00:00
Filipe Cabecinhas 7a24104293 [xcore] Make the exceptions test actually check for the absence of -fexceptions in the proper place
llvm-svn: 227443
2015-01-29 15:03:36 +00:00
Robert Lytton 894d25c1e0 XCore target: fix handling of -g0 flag
llvm-svn: 207833
2014-05-02 09:33:25 +00:00
Nico Rieck e6a1582595 Fix broken CHECK lines
llvm-svn: 201477
2014-02-16 07:29:41 +00:00
Robert Lytton 9e8c1a4b57 XCore target pass -v flag to assembler & linker
llvm-svn: 201312
2014-02-13 10:40:12 +00:00
Robert Lytton f7e03c1cff XCore target -fexceptions flag handling
XCore target has -fno-exception as the default option
Pass on "-fexceptions" flag to xcc (linker)

llvm-svn: 201310
2014-02-13 10:34:44 +00:00
Robert Lytton 8e95d4e075 XCore target: Pass through "-fverbose-asm" flag to xcc assembler.
llvm-svn: 201141
2014-02-11 10:34:45 +00:00
Robert Lytton 6b1deb4cf9 XCore target has -fno-use-cxa-atexit as default.
llvm-svn: 194460
2013-11-12 10:09:22 +00:00
Robert Lytton 8b1cf73c9a remove path separator from test/Driver/xcore-opts.c
llvm-svn: 192439
2013-10-11 10:55:53 +00:00
Robert Lytton cf1dd692ae XCore target: add an xcore toolchain implementation
llvm-svn: 192437
2013-10-11 10:29:40 +00:00
Robert Lytton 01081113c2 fix xcore-opts.c test
llvm-svn: 190526
2013-09-11 15:14:38 +00:00
Robert Lytton a7d1d865e5 XCore target: correct test layout
llvm-svn: 188663
2013-08-19 09:46:32 +00:00
Robert Lytton 0e07649ae5 Add XCore target
llvm-svn: 188258
2013-08-13 09:43:10 +00:00