about summary refs log tree commit diff
path: root/compiler/rustc_target
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2022-08-25 17:52:37 +1000
committerNicholas Nethercote <n.nethercote@gmail.com>2022-08-26 09:35:28 +1000
commite4bf113027aca77fea447e15fc09a7c8ded701e9 (patch)
treeb6eff452338b37a0e064a6ac6ca32c8828bab105 /compiler/rustc_target
parent263c426bfd2d8119ad9f615fc0616cf01984435a (diff)
downloadrust-e4bf113027aca77fea447e15fc09a7c8ded701e9.tar.gz
rust-e4bf113027aca77fea447e15fc09a7c8ded701e9.zip
Box `CastTarget` within `PassMode`.
Because `PassMode::Cast` is by far the largest variant, but is
relatively rare.

This requires making `PassMode` not impl `Copy`, and `Clone` is no
longer necessary. This causes lots of sigil adjusting, but nothing very
notable.
Diffstat (limited to 'compiler/rustc_target')
-rw-r--r--compiler/rustc_target/src/abi/call/mod.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/rustc_target/src/abi/call/mod.rs b/compiler/rustc_target/src/abi/call/mod.rs
index ab53ea6101d..d4430b1609b 100644
--- a/compiler/rustc_target/src/abi/call/mod.rs
+++ b/compiler/rustc_target/src/abi/call/mod.rs
@@ -26,7 +26,7 @@ mod x86;
 mod x86_64;
 mod x86_win64;
 
-#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug, HashStable_Generic)]
+#[derive(PartialEq, Eq, Hash, Debug, HashStable_Generic)]
 pub enum PassMode {
     /// Ignore the argument.
     ///
@@ -42,7 +42,7 @@ pub enum PassMode {
     Pair(ArgAttributes, ArgAttributes),
     /// Pass the argument after casting it, to either
     /// a single uniform or a pair of registers.
-    Cast(CastTarget),
+    Cast(Box<CastTarget>),
     /// Pass the argument indirectly via a hidden pointer.
     /// The `extra_attrs` value, if any, is for the extra data (vtable or length)
     /// which indicates that it refers to an unsized rvalue.
@@ -548,7 +548,7 @@ impl<'a, Ty> ArgAbi<'a, Ty> {
     }
 
     pub fn cast_to<T: Into<CastTarget>>(&mut self, target: T) {
-        self.mode = PassMode::Cast(target.into());
+        self.mode = PassMode::Cast(Box::new(target.into()));
     }
 
     pub fn pad_with(&mut self, reg: Reg) {
@@ -737,6 +737,6 @@ mod size_asserts {
     use super::*;
     use rustc_data_structures::static_assert_size;
     // These are in alphabetical order, which is easy to maintain.
-    static_assert_size!(ArgAbi<'_, usize>, 208);
-    static_assert_size!(FnAbi<'_, usize>, 248);
+    static_assert_size!(ArgAbi<'_, usize>, 72);
+    static_assert_size!(FnAbi<'_, usize>, 112);
 }