|
5 | 5 | use rustc_middle::ty;
|
6 | 6 | use rustc_target::callconv::{self, Conv};
|
7 | 7 | use stable_mir::abi::{
|
8 |
| - AddressSpace, ArgAbi, CallConvention, FieldsShape, FloatLength, FnAbi, IntegerLength, Layout, |
9 |
| - LayoutShape, PassMode, Primitive, Scalar, TagEncoding, TyAndLayout, ValueAbi, VariantsShape, |
10 |
| - WrappingRange, |
| 8 | + AddressSpace, ArgAbi, CallConvention, FieldsShape, FloatLength, FnAbi, IntegerLength, |
| 9 | + IntegerType, Layout, LayoutShape, PassMode, Primitive, ReprFlags, ReprOptions, Scalar, |
| 10 | + TagEncoding, TyAndLayout, ValueAbi, VariantsShape, WrappingRange, |
11 | 11 | };
|
12 | 12 | use stable_mir::opaque;
|
13 | 13 | use stable_mir::target::MachineSize as Size;
|
@@ -303,3 +303,37 @@ impl<'tcx> Stable<'tcx> for rustc_abi::WrappingRange {
|
303 | 303 | WrappingRange { start: self.start, end: self.end }
|
304 | 304 | }
|
305 | 305 | }
|
| 306 | + |
| 307 | +impl<'tcx> Stable<'tcx> for rustc_abi::ReprFlags { |
| 308 | + type T = ReprFlags; |
| 309 | + |
| 310 | + fn stable(&self, _tables: &mut Tables<'_>) -> Self::T { |
| 311 | + self.bits() |
| 312 | + } |
| 313 | +} |
| 314 | + |
| 315 | +impl<'tcx> Stable<'tcx> for rustc_abi::IntegerType { |
| 316 | + type T = IntegerType; |
| 317 | + |
| 318 | + fn stable(&self, tables: &mut Tables<'_>) -> Self::T { |
| 319 | + match self { |
| 320 | + rustc_abi::IntegerType::Pointer(signed) => IntegerType::Pointer(*signed), |
| 321 | + rustc_abi::IntegerType::Fixed(integer, signed) => { |
| 322 | + IntegerType::Fixed(integer.stable(tables), *signed) |
| 323 | + } |
| 324 | + } |
| 325 | + } |
| 326 | +} |
| 327 | + |
| 328 | +impl<'tcx> Stable<'tcx> for rustc_abi::ReprOptions { |
| 329 | + type T = ReprOptions; |
| 330 | + |
| 331 | + fn stable(&self, tables: &mut Tables<'_>) -> Self::T { |
| 332 | + ReprOptions { |
| 333 | + int: self.int.map(|int| int.stable(tables)), |
| 334 | + align: self.align.map(|align| align.stable(tables)), |
| 335 | + pack: self.pack.map(|pack| pack.stable(tables)), |
| 336 | + flags: self.flags.stable(tables), |
| 337 | + } |
| 338 | + } |
| 339 | +} |
0 commit comments