about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-06-23 11:12:11 +0000
committerbors <bors@rust-lang.org>2024-06-23 11:12:11 +0000
commitc3d7fb398569407350abe044e786bc7890c90397 (patch)
tree625b8d3796cb46549d177456dde2ff2ffce5a9a3 /compiler/rustc_codegen_llvm/src
parent05468cf1241ae661c84e43d6a41d7a0ba317eebf (diff)
parent761ba5bb073578c6a510482be8338075f0b71493 (diff)
downloadrust-c3d7fb398569407350abe044e786bc7890c90397.tar.gz
rust-c3d7fb398569407350abe044e786bc7890c90397.zip
Auto merge of #124733 - workingjubilee:cant-beleaf-we-dont-have-this, r=saethlin
Support `-Cforce-frame-pointers=non-leaf`

Why don't we already support this...?

Suggested impl for https://github.com/rust-lang/compiler-team/issues/744
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
-rw-r--r--compiler/rustc_codegen_llvm/src/attributes.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/rustc_codegen_llvm/src/attributes.rs b/compiler/rustc_codegen_llvm/src/attributes.rs
index 870e5ab3296..48693895da1 100644
--- a/compiler/rustc_codegen_llvm/src/attributes.rs
+++ b/compiler/rustc_codegen_llvm/src/attributes.rs
@@ -108,9 +108,10 @@ pub fn frame_pointer_type_attr<'ll>(cx: &CodegenCx<'ll, '_>) -> Option<&'ll Attr
     let opts = &cx.sess().opts;
     // "mcount" function relies on stack pointer.
     // See <https://sourceware.org/binutils/docs/gprof/Implementation.html>.
-    if opts.unstable_opts.instrument_mcount || matches!(opts.cg.force_frame_pointers, Some(true)) {
-        fp = FramePointer::Always;
+    if opts.unstable_opts.instrument_mcount {
+        fp.ratchet(FramePointer::Always);
     }
+    fp.ratchet(opts.cg.force_frame_pointers);
     let attr_value = match fp {
         FramePointer::Always => "all",
         FramePointer::NonLeaf => "non-leaf",