about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJubilee Young <workingjubilee@gmail.com>2025-02-11 22:33:18 -0800
committerJubilee Young <workingjubilee@gmail.com>2025-02-17 15:10:51 -0800
commit59e9eb9b2bce23fb948a3944adb127206e73d1e4 (patch)
tree6e1a9b9219deff84a52eadec6f6fc1f3cc8c27a9
parentce36a966c79e109dabeef7a47fe68e5294c6d71e (diff)
downloadrust-59e9eb9b2bce23fb948a3944adb127206e73d1e4.tar.gz
rust-59e9eb9b2bce23fb948a3944adb127206e73d1e4.zip
cg_clif: use exclusively ABI alignment
-rw-r--r--compiler/rustc_codegen_cranelift/src/abi/comments.rs5
-rw-r--r--compiler/rustc_codegen_cranelift/src/constant.rs2
2 files changed, 3 insertions, 4 deletions
diff --git a/compiler/rustc_codegen_cranelift/src/abi/comments.rs b/compiler/rustc_codegen_cranelift/src/abi/comments.rs
index 521a250ab82..e2c9f40d147 100644
--- a/compiler/rustc_codegen_cranelift/src/abi/comments.rs
+++ b/compiler/rustc_codegen_cranelift/src/abi/comments.rs
@@ -65,7 +65,7 @@ pub(super) fn add_locals_header_comment(fx: &mut FunctionCx<'_, '_, '_>) {
     if fx.clif_comments.enabled() {
         fx.add_global_comment(String::new());
         fx.add_global_comment(
-            "kind  local ty                              size align (abi,pref)".to_string(),
+            "kind  local ty                              size align (abi)".to_string(),
         );
     }
 }
@@ -84,13 +84,12 @@ pub(super) fn add_local_place_comments<'tcx>(
     let (kind, extra) = place.debug_comment();
 
     fx.add_global_comment(format!(
-        "{:<5} {:5} {:30} {:4}b {}, {}{}{}",
+        "{:<5} {:5} {:30} {:4}b {}, {}{}",
         kind,
         format!("{:?}", local),
         format!("{:?}", ty),
         size.bytes(),
         align.abi.bytes(),
-        align.pref.bytes(),
         if extra.is_empty() { "" } else { "              " },
         extra,
     ));
diff --git a/compiler/rustc_codegen_cranelift/src/constant.rs b/compiler/rustc_codegen_cranelift/src/constant.rs
index 425b2adf32a..bcc70f4567f 100644
--- a/compiler/rustc_codegen_cranelift/src/constant.rs
+++ b/compiler/rustc_codegen_cranelift/src/constant.rs
@@ -272,7 +272,7 @@ fn data_id_for_static(
             .layout_of(ty::TypingEnv::fully_monomorphized().as_query_input(ty))
             .unwrap()
             .align
-            .pref
+            .abi
             .bytes();
 
         let linkage = if import_linkage == rustc_middle::mir::mono::Linkage::ExternalWeak