Add missing types in the type_kind function
reorder type_kind reorder type_kind reorder type_kind fix fix fix fix
This commit is contained in:
parent
fa18a181f7
commit
b94cb8c01c
16
src/type_.rs
16
src/type_.rs
@ -194,12 +194,20 @@ fn type_struct(&self, fields: &[Type<'gcc>], packed: bool) -> Type<'gcc> {
|
|||||||
fn type_kind(&self, typ: Type<'gcc>) -> TypeKind {
|
fn type_kind(&self, typ: Type<'gcc>) -> TypeKind {
|
||||||
if self.is_int_type_or_bool(typ) {
|
if self.is_int_type_or_bool(typ) {
|
||||||
TypeKind::Integer
|
TypeKind::Integer
|
||||||
|
} else if typ.get_pointee().is_some() {
|
||||||
|
TypeKind::Pointer
|
||||||
|
} else if typ.is_vector() {
|
||||||
|
TypeKind::Vector
|
||||||
|
} else if typ.dyncast_array().is_some() {
|
||||||
|
TypeKind::Array
|
||||||
|
} else if typ.is_struct().is_some() {
|
||||||
|
TypeKind::Struct
|
||||||
|
} else if typ.dyncast_function_ptr_type().is_some() {
|
||||||
|
TypeKind::Function
|
||||||
} else if typ.is_compatible_with(self.float_type) {
|
} else if typ.is_compatible_with(self.float_type) {
|
||||||
TypeKind::Float
|
TypeKind::Float
|
||||||
} else if typ.is_compatible_with(self.double_type) {
|
} else if typ.is_compatible_with(self.double_type) {
|
||||||
TypeKind::Double
|
TypeKind::Double
|
||||||
} else if typ.is_vector() {
|
|
||||||
TypeKind::Vector
|
|
||||||
} else if typ.is_floating_point() {
|
} else if typ.is_floating_point() {
|
||||||
match typ.get_size() {
|
match typ.get_size() {
|
||||||
2 => TypeKind::Half,
|
2 => TypeKind::Half,
|
||||||
@ -208,9 +216,11 @@ fn type_kind(&self, typ: Type<'gcc>) -> TypeKind {
|
|||||||
16 => TypeKind::FP128,
|
16 => TypeKind::FP128,
|
||||||
_ => TypeKind::Void,
|
_ => TypeKind::Void,
|
||||||
}
|
}
|
||||||
|
} else if typ == self.type_void() {
|
||||||
|
TypeKind::Void
|
||||||
} else {
|
} else {
|
||||||
// TODO(antoyo): support other types.
|
// TODO(antoyo): support other types.
|
||||||
TypeKind::Void
|
unimplemented!();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user