about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/context.rs
diff options
context:
space:
mode:
authorAlice Ryhl <aliceryhl@google.com>2025-05-07 07:57:01 +0000
committerMiguel Ojeda <ojeda@kernel.org>2025-08-17 16:50:23 +0200
commit1cd7080c3a7f29297675a72a157575ae12717304 (patch)
tree35d6a3c3595ce61fc4aeae69a1c9b9b85b77738b /compiler/rustc_codegen_llvm/src/context.rs
parent425a9c0a0e365c0b8c6cfd00c2ded83a73bed9a0 (diff)
downloadrust-1cd7080c3a7f29297675a72a157575ae12717304.tar.gz
rust-1cd7080c3a7f29297675a72a157575ae12717304.zip
Add -Zindirect-branch-cs-prefix (from draft PR)
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/context.rs')
-rw-r--r--compiler/rustc_codegen_llvm/src/context.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_llvm/src/context.rs b/compiler/rustc_codegen_llvm/src/context.rs
index b0f3494ea68..ea3a21dfdb5 100644
--- a/compiler/rustc_codegen_llvm/src/context.rs
+++ b/compiler/rustc_codegen_llvm/src/context.rs
@@ -462,6 +462,15 @@ pub(crate) unsafe fn create_module<'ll>(
         }
     }
 
+    if sess.opts.unstable_opts.indirect_branch_cs_prefix {
+        llvm::add_module_flag_u32(
+            llmod,
+            llvm::ModuleFlagMergeBehavior::Override,
+            "indirect_branch_cs_prefix",
+            1,
+        );
+    }
+
     match (sess.opts.unstable_opts.small_data_threshold, sess.target.small_data_threshold_support())
     {
         // Set up the small-data optimization limit for architectures that use