Refactor float Primitive
s to a separate Float
type
This commit is contained in:
parent
8cef37dbb6
commit
3769fddba2
23 changed files with 156 additions and 96 deletions
|
@ -18,7 +18,7 @@ use rustc_middle::ty::layout::{FnAbiOf, HasTyCtxt, LayoutOf};
|
|||
use rustc_middle::ty::{self, GenericArgsRef, Ty};
|
||||
use rustc_middle::{bug, span_bug};
|
||||
use rustc_span::{sym, Span, Symbol};
|
||||
use rustc_target::abi::{self, Align, HasDataLayout, Primitive, Size};
|
||||
use rustc_target::abi::{self, Align, Float, HasDataLayout, Primitive, Size};
|
||||
use rustc_target::spec::{HasTargetSpec, PanicStrategy};
|
||||
|
||||
use std::cmp::Ordering;
|
||||
|
@ -231,13 +231,17 @@ impl<'ll, 'tcx> IntrinsicCallMethods<'tcx> for Builder<'_, 'll, 'tcx> {
|
|||
emit_va_arg(self, args[0], ret_ty)
|
||||
}
|
||||
}
|
||||
Primitive::F16 => bug!("the va_arg intrinsic does not work with `f16`"),
|
||||
Primitive::F64 | Primitive::Pointer(_) => {
|
||||
Primitive::Float(Float::F16) => {
|
||||
bug!("the va_arg intrinsic does not work with `f16`")
|
||||
}
|
||||
Primitive::Float(Float::F64) | Primitive::Pointer(_) => {
|
||||
emit_va_arg(self, args[0], ret_ty)
|
||||
}
|
||||
// `va_arg` should never be used with the return type f32.
|
||||
Primitive::F32 => bug!("the va_arg intrinsic does not work with `f32`"),
|
||||
Primitive::F128 => {
|
||||
Primitive::Float(Float::F32) => {
|
||||
bug!("the va_arg intrinsic does not work with `f32`")
|
||||
}
|
||||
Primitive::Float(Float::F128) => {
|
||||
bug!("the va_arg intrinsic does not work with `f128`")
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue