Skip to content

Commit

Permalink
Add missing types in the type_kind function
Browse files Browse the repository at this point in the history
reorder type_kind

reorder type_kind

reorder type_kind

fix

fix

fix

fix
  • Loading branch information
Robert Zakrzewski committed May 13, 2024
1 parent 10798db commit 7004c96
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/type_.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,12 +194,20 @@ impl<'gcc, 'tcx> BaseTypeMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
fn type_kind(&self, typ: Type<'gcc>) -> TypeKind {
if self.is_int_type_or_bool(typ) {
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) {
TypeKind::Float
} else if typ.is_compatible_with(self.double_type) {
TypeKind::Double
} else if typ.is_vector() {
TypeKind::Vector
} else if typ.is_floating_point() {
match typ.get_size() {
2 => TypeKind::Half,
Expand All @@ -208,9 +216,11 @@ impl<'gcc, 'tcx> BaseTypeMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
16 => TypeKind::FP128,
_ => TypeKind::Void,
}
} else if typ == self.type_void() {
TypeKind::Void
} else {
// TODO(antoyo): support other types.
TypeKind::Void
unimplemented!();
}
}

Expand Down

0 comments on commit 7004c96

Please sign in to comment.