about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/attributes.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-10-08 06:16:31 +0000
committerbors <bors@rust-lang.org>2021-10-08 06:16:31 +0000
commit3013b26947e956352f95edfa39251319520cb06c (patch)
tree5debef34b4d6ef94b38dbb51099a499d72daaa2c /compiler/rustc_codegen_llvm/src/attributes.rs
parentc2171ee53ef2c98addbc3543e50e61496d8440a9 (diff)
parent30e068f58b46d42b0e71b5112ceb2193f376ecc2 (diff)
downloadrust-3013b26947e956352f95edfa39251319520cb06c.tar.gz
rust-3013b26947e956352f95edfa39251319520cb06c.zip
Auto merge of #89659 - workingjubilee:rollup-0vggc69, r=workingjubilee
Rollup of 8 pull requests

Successful merges:

 - #87918 (Enable AutoFDO.)
 - #88137 (On macOS, make strip="symbols" not pass any options to strip)
 - #88772 (Fixed confusing wording on Result::map_or_else.)
 - #89025 (Implement `#[link_ordinal(n)]`)
 - #89082 (Implement #85440 (Random test ordering))
 - #89288 (Wrapper for `-Z gcc-ld=lld` to invoke rust-lld with the correct flavor)
 - #89476 (Correct decoding of foreign expansions during incr. comp.)
 - #89622 (Use correct edition for panic in [debug_]assert!().)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/attributes.rs')
-rw-r--r--compiler/rustc_codegen_llvm/src/attributes.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_llvm/src/attributes.rs b/compiler/rustc_codegen_llvm/src/attributes.rs
index 51c70f0868f..659cf9ea070 100644
--- a/compiler/rustc_codegen_llvm/src/attributes.rs
+++ b/compiler/rustc_codegen_llvm/src/attributes.rs
@@ -263,6 +263,10 @@ pub fn from_fn_attrs(cx: &CodegenCx<'ll, 'tcx>, llfn: &'ll Value, instance: ty::
         attributes::emit_uwtable(llfn, true);
     }
 
+    if cx.sess().opts.debugging_opts.profile_sample_use.is_some() {
+        llvm::AddFunctionAttrString(llfn, Function, cstr!("use-sample-profile"));
+    }
+
     // FIXME: none of these three functions interact with source level attributes.
     set_frame_pointer_type(cx, llfn);
     set_instrument_function(cx, llfn);