Skip to content

Commit b94cb8c

Browse files
author
Robert Zakrzewski
committed
Add missing types in the type_kind function
reorder type_kind reorder type_kind reorder type_kind fix fix fix fix
1 parent fa18a18 commit b94cb8c

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

src/type_.rs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,12 +194,20 @@ impl<'gcc, 'tcx> BaseTypeMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
194194
fn type_kind(&self, typ: Type<'gcc>) -> TypeKind {
195195
if self.is_int_type_or_bool(typ) {
196196
TypeKind::Integer
197+
} else if typ.get_pointee().is_some() {
198+
TypeKind::Pointer
199+
} else if typ.is_vector() {
200+
TypeKind::Vector
201+
} else if typ.dyncast_array().is_some() {
202+
TypeKind::Array
203+
} else if typ.is_struct().is_some() {
204+
TypeKind::Struct
205+
} else if typ.dyncast_function_ptr_type().is_some() {
206+
TypeKind::Function
197207
} else if typ.is_compatible_with(self.float_type) {
198208
TypeKind::Float
199209
} else if typ.is_compatible_with(self.double_type) {
200210
TypeKind::Double
201-
} else if typ.is_vector() {
202-
TypeKind::Vector
203211
} else if typ.is_floating_point() {
204212
match typ.get_size() {
205213
2 => TypeKind::Half,
@@ -208,9 +216,11 @@ impl<'gcc, 'tcx> BaseTypeMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
208216
16 => TypeKind::FP128,
209217
_ => TypeKind::Void,
210218
}
219+
} else if typ == self.type_void() {
220+
TypeKind::Void
211221
} else {
212222
// TODO(antoyo): support other types.
213-
TypeKind::Void
223+
unimplemented!();
214224
}
215225
}
216226

0 commit comments

Comments
 (0)