about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/llvm_util.rs
diff options
context:
space:
mode:
authorAlice Ryhl <aliceryhl@google.com>2024-05-03 14:32:01 +0200
committerAlice Ryhl <aliceryhl@google.com>2024-05-03 14:32:08 +0200
commit40f0172c6aed0b2fb055c19108d226f8fb410f8c (patch)
treed06225635b01a71129568d86100bfc182204cdee /compiler/rustc_codegen_llvm/src/llvm_util.rs
parent79734f1db8dbe322192dea32c0f6b80ab14c4c1d (diff)
downloadrust-40f0172c6aed0b2fb055c19108d226f8fb410f8c.tar.gz
rust-40f0172c6aed0b2fb055c19108d226f8fb410f8c.zip
Add -Zfixed-x18
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/llvm_util.rs')
-rw-r--r--compiler/rustc_codegen_llvm/src/llvm_util.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_llvm/src/llvm_util.rs b/compiler/rustc_codegen_llvm/src/llvm_util.rs
index 5552b381025..dbce7f43e62 100644
--- a/compiler/rustc_codegen_llvm/src/llvm_util.rs
+++ b/compiler/rustc_codegen_llvm/src/llvm_util.rs
@@ -615,6 +615,11 @@ pub(crate) fn global_llvm_features(sess: &Session, diagnostics: bool) -> Vec<Str
         .flatten();
     features.extend(feats);
 
+    // -Zfixed-x18
+    if sess.opts.unstable_opts.fixed_x18 {
+        features.push("+reserve-x18".into());
+    }
+
     if diagnostics && let Some(f) = check_tied_features(sess, &featsmap) {
         sess.dcx().emit_err(TargetFeatureDisableOrEnable {
             features: f,