[PATCH] D64294: [Driver] Consolidate shouldUseFramePointer() and shouldUseLeafFramePointer()

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Jul 6 23:18:12 PDT 2019


MaskRay created this revision.
MaskRay added reviewers: chandlerc, dim, echristo, rnk, rsmith, void, ychen.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Use a tri-state enum to represent shouldUseFramePointer() and
shouldUseLeafFramePointer().

This simplifies the logic and fixes PR9825:

  need both -fno-omit-frame-pointer and -mno-omit-leaf-frame-pointer to
  generate fp on a leaf function.

and PR24003:

  /Oy- /O2 should not omit leaf frame pointer.

and:

  when CC1 option -mdisable-fp-elim if absent, -momit-leaf-frame-pointer
  can also be omitted.


Repository:
  rC Clang

https://reviews.llvm.org/D64294

Files:
  lib/Driver/ToolChains/Clang.cpp
  test/Driver/cl-options.c
  test/Driver/frame-pointer-elim.c
  test/Driver/xcore-opts.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D64294.208288.patch
Type: text/x-patch
Size: 9939 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190707/e0bd210d/attachment-0001.bin>


More information about the cfe-commits mailing list