@@ -402,47 +402,62 @@ constexpr TypeBuilderFunc getModel<bool &>() {
402402}
403403template <>
404404constexpr TypeBuilderFunc getModel<unsigned short >() {
405- return getModel<short >();
405+ return [](mlir::MLIRContext *context) -> mlir::Type {
406+ return mlir::IntegerType::get (
407+ context, 8 * sizeof (unsigned short ),
408+ mlir::IntegerType::SignednessSemantics::Unsigned);
409+ };
406410}
407411template <>
408412constexpr TypeBuilderFunc getModel<unsigned char *>() {
409- return getModel<char *>();
413+ return [](mlir::MLIRContext *context) -> mlir::Type {
414+ return fir::ReferenceType::get (mlir::IntegerType::get (context, 8 ));
415+ };
410416}
411417template <>
412418constexpr TypeBuilderFunc getModel<const unsigned char *>() {
413- return getModel<char *>();
419+ return getModel<unsigned char *>();
414420}
415421template <>
416422constexpr TypeBuilderFunc getModel<unsigned short *>() {
417- return getModel<short *>();
423+ return [](mlir::MLIRContext *context) -> mlir::Type {
424+ return fir::ReferenceType::get (
425+ mlir::IntegerType::get (context, 8 * sizeof (unsigned short )));
426+ };
418427}
419428template <>
420429constexpr TypeBuilderFunc getModel<const unsigned short *>() {
421- return getModel<short *>();
430+ return getModel<unsigned short *>();
422431}
423432template <>
424433constexpr TypeBuilderFunc getModel<unsigned *>() {
425434 return getModel<int *>();
426435}
427436template <>
428437constexpr TypeBuilderFunc getModel<const unsigned *>() {
429- return getModel<int *>();
438+ return getModel<unsigned *>();
430439}
431440template <>
432441constexpr TypeBuilderFunc getModel<unsigned long *>() {
433- return getModel<long *>();
442+ return [](mlir::MLIRContext *context) -> mlir::Type {
443+ return fir::ReferenceType::get (
444+ mlir::IntegerType::get (context, 8 * sizeof (unsigned long )));
445+ };
434446}
435447template <>
436448constexpr TypeBuilderFunc getModel<const unsigned long *>() {
437- return getModel<long *>();
449+ return getModel<unsigned long *>();
438450}
439451template <>
440452constexpr TypeBuilderFunc getModel<unsigned long long *>() {
441- return getModel<long long *>();
453+ return [](mlir::MLIRContext *context) -> mlir::Type {
454+ return fir::ReferenceType::get (
455+ mlir::IntegerType::get (context, 8 * sizeof (unsigned long long )));
456+ };
442457}
443458template <>
444459constexpr TypeBuilderFunc getModel<const unsigned long long *>() {
445- return getModel<long long *>();
460+ return getModel<unsigned long long *>();
446461}
447462template <>
448463constexpr TypeBuilderFunc getModel<Fortran::common::uint128_t >() {
@@ -461,7 +476,7 @@ constexpr TypeBuilderFunc getModel<Fortran::common::uint128_t *>() {
461476}
462477template <>
463478constexpr TypeBuilderFunc getModel<const Fortran::common::uint128_t *>() {
464- return getModel<Fortran::common::int128_t *>();
479+ return getModel<Fortran::common::uint128_t *>();
465480}
466481
467482// getModel<std::complex<T>> are not implemented on purpose.
0 commit comments