diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2022-12-25 22:15:00 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-12-25 22:15:00 +0100 |
| commit | 6689d2df08af58fb876126ad47bb279f3b789dfc (patch) | |
| tree | d5ad650fb98b52ea2ec6c2e4a3c12ccee8181a77 /compiler/rustc_codegen_llvm/src/attributes.rs | |
| parent | 44065e4184de61d9d3b46ae53bcdbc5e8674ed6f (diff) | |
| parent | fb79e44df6310ab449cee6ef82d7672b7e43d4e8 (diff) | |
| download | rust-6689d2df08af58fb876126ad47bb279f3b789dfc.tar.gz rust-6689d2df08af58fb876126ad47bb279f3b789dfc.zip | |
Rollup merge of #105955 - Nilstrieb:no-trivial-opt-wrappers-we-have-field-accesses-for-that, r=cjgillot
Remove wrapper functions for some unstable options They are trivial and just forward to the option. Like most other options, we can just access it directly.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/attributes.rs')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/attributes.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_codegen_llvm/src/attributes.rs b/compiler/rustc_codegen_llvm/src/attributes.rs index 487eead22b8..95baa95b021 100644 --- a/compiler/rustc_codegen_llvm/src/attributes.rs +++ b/compiler/rustc_codegen_llvm/src/attributes.rs @@ -102,10 +102,10 @@ pub fn uwtable_attr(llcx: &llvm::Context) -> &Attribute { pub fn frame_pointer_type_attr<'ll>(cx: &CodegenCx<'ll, '_>) -> Option<&'ll Attribute> { let mut fp = cx.sess().target.frame_pointer; + let opts = &cx.sess().opts; // "mcount" function relies on stack pointer. // See <https://sourceware.org/binutils/docs/gprof/Implementation.html>. - if cx.sess().instrument_mcount() || matches!(cx.sess().opts.cg.force_frame_pointers, Some(true)) - { + if opts.unstable_opts.instrument_mcount || matches!(opts.cg.force_frame_pointers, Some(true)) { fp = FramePointer::Always; } let attr_value = match fp { @@ -119,7 +119,7 @@ pub fn frame_pointer_type_attr<'ll>(cx: &CodegenCx<'ll, '_>) -> Option<&'ll Attr /// Tell LLVM what instrument function to insert. #[inline] fn instrument_function_attr<'ll>(cx: &CodegenCx<'ll, '_>) -> Option<&'ll Attribute> { - if cx.sess().instrument_mcount() { + if cx.sess().opts.unstable_opts.instrument_mcount { // Similar to `clang -pg` behavior. Handled by the // `post-inline-ee-instrument` LLVM pass. |
