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
  • Loading branch information
Robert Zakrzewski committed May 13, 2024
1 parent 10798db commit 694f602
Show file tree
Hide file tree
Showing 2 changed files with 46 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
33 changes: 33 additions & 0 deletions tests/failing-ui-tests.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,36 @@ tests/ui/consts/issue-94675.rs
tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-fail.rs
tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop.rs

tests/ui/lint/unsafe_code/forge_unsafe_block.rs
tests/ui/lint/unused-qualification-in-derive-expansion.rs
tests/ui/macros/macro-quote-test.rs
tests/ui/macros/proc_macro.rs
tests/ui/panic-runtime/lto-unwind.rs
tests/ui/resolve/derive-macro-1.rs
tests/ui/resolve/derive-macro-2.rs
tests/ui/rfcs/rfc-2565-param-attrs/param-attrs-pretty.rs
tests/ui/rfcs/rfc-2565-param-attrs/issue-64682-dropping-first-attrs-in-impl-fns.rs
tests/ui/rfcs/rfc-3348-c-string-literals/edition-spans.rs
tests/ui/rust-2018/suggestions-not-always-applicable.rs
tests/ui/rust-2021/reserved-prefixes-via-macro.rs
tests/ui/underscore-imports/duplicate.rs
tests/ui/async-await/issues/issue-60674.rs
tests/ui/attributes/main-removed-2/main.rs
tests/ui/cfg/assume-incomplete-release/assume-incomplete.rs
tests/ui/crate-loading/cross-compiled-proc-macro.rs
tests/ui/derives/derive-marker-tricky.rs
tests/ui/diagnostic_namespace/existing_proc_macros.rs
tests/ui/fmt/format-args-capture-issue-106408.rs
tests/ui/fmt/indoc-issue-106408.rs
tests/ui/hygiene/issue-77523-def-site-async-await.rs
tests/ui/inherent-impls-overlap-check/no-overlap.rs
tests/ui/enum-discriminant/issue-46519.rs
tests/ui/issues/issue-45731.rs
tests/ui/lint/test-allow-dead-extern-static-no-warning.rs
tests/ui/macros/macro-comma-behavior-rpass.rs
tests/ui/macros/rfc-2011-nicer-assert-messages/assert-with-custom-errors-does-not-create-unnecessary-code.rs
tests/ui/macros/rfc-2011-nicer-assert-messages/feature-gate-generic_assert.rs
tests/ui/macros/stringify.rs
tests/ui/reexport-test-harness-main.rs
tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-in-test.rs
tests/ui/binding/fn-arg-incomplete-pattern-drop-order.rs

0 comments on commit 694f602

Please sign in to comment.