Skip to content

Commit f26221a

Browse files
committed
Refactor float Primitives to a separate Float type
1 parent efa15eb commit f26221a

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/type_of.rs

+3-6
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ use rustc_middle::ty::print::with_no_trimmed_paths;
88
use rustc_middle::ty::{self, Ty, TypeVisitableExt};
99
use rustc_target::abi::call::{CastTarget, FnAbi, Reg};
1010
use rustc_target::abi::{
11-
self, Abi, Align, FieldsShape, Int, Integer, PointeeInfo, Pointer, Size, TyAbiInterface,
12-
Variants, F128, F16, F32, F64,
11+
self, Abi, Align, FieldsShape, Float, Int, Integer, PointeeInfo, Pointer, Size, TyAbiInterface,
12+
Variants,
1313
};
1414

1515
use crate::abi::{FnAbiGcc, FnAbiGccExt, GccType};
@@ -283,10 +283,7 @@ impl<'tcx> LayoutGccExt<'tcx> for TyAndLayout<'tcx> {
283283
match scalar.primitive() {
284284
Int(i, true) => cx.type_from_integer(i),
285285
Int(i, false) => cx.type_from_unsigned_integer(i),
286-
F16 => cx.type_f16(),
287-
F32 => cx.type_f32(),
288-
F64 => cx.type_f64(),
289-
F128 => cx.type_f128(),
286+
Float(f) => cx.type_from_float(f),
290287
Pointer(address_space) => {
291288
// If we know the alignment, pick something better than i8.
292289
let pointee = if let Some(pointee) = self.pointee_info_at(cx, offset) {

0 commit comments

Comments
 (0)