@@ -402,47 +402,62 @@ constexpr TypeBuilderFunc getModel<bool &>() {
402
402
}
403
403
template <>
404
404
constexpr 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
+ };
406
410
}
407
411
template <>
408
412
constexpr 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
+ };
410
416
}
411
417
template <>
412
418
constexpr TypeBuilderFunc getModel<const unsigned char *>() {
413
- return getModel<char *>();
419
+ return getModel<unsigned char *>();
414
420
}
415
421
template <>
416
422
constexpr 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
+ };
418
427
}
419
428
template <>
420
429
constexpr TypeBuilderFunc getModel<const unsigned short *>() {
421
- return getModel<short *>();
430
+ return getModel<unsigned short *>();
422
431
}
423
432
template <>
424
433
constexpr TypeBuilderFunc getModel<unsigned *>() {
425
434
return getModel<int *>();
426
435
}
427
436
template <>
428
437
constexpr TypeBuilderFunc getModel<const unsigned *>() {
429
- return getModel<int *>();
438
+ return getModel<unsigned *>();
430
439
}
431
440
template <>
432
441
constexpr 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
+ };
434
446
}
435
447
template <>
436
448
constexpr TypeBuilderFunc getModel<const unsigned long *>() {
437
- return getModel<long *>();
449
+ return getModel<unsigned long *>();
438
450
}
439
451
template <>
440
452
constexpr 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
+ };
442
457
}
443
458
template <>
444
459
constexpr TypeBuilderFunc getModel<const unsigned long long *>() {
445
- return getModel<long long *>();
460
+ return getModel<unsigned long long *>();
446
461
}
447
462
template <>
448
463
constexpr TypeBuilderFunc getModel<Fortran::common::uint128_t >() {
@@ -461,7 +476,7 @@ constexpr TypeBuilderFunc getModel<Fortran::common::uint128_t *>() {
461
476
}
462
477
template <>
463
478
constexpr TypeBuilderFunc getModel<const Fortran::common::uint128_t *>() {
464
- return getModel<Fortran::common::int128_t *>();
479
+ return getModel<Fortran::common::uint128_t *>();
465
480
}
466
481
467
482
// getModel<std::complex<T>> are not implemented on purpose.
0 commit comments