File tree Expand file tree Collapse file tree 4 files changed +8
-3
lines changed
Expand file tree Collapse file tree 4 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -429,6 +429,7 @@ cast_kind
429429 | IntegerToCharacter
430430 | LogicalToCharacter
431431 | UnsignedIntegerToInteger
432+ | UnsignedIntegerToUnsignedInteger
432433 | UnsignedIntegerToReal
433434 | UnsignedIntegerToLogical
434435 | IntegerToUnsignedInteger
Original file line number Diff line number Diff line change @@ -1754,8 +1754,10 @@ PyMODINIT_FUNC PyInit_lpython_module_)" + fn_name + R"((void) {
17541754 // src = src;
17551755 break ;
17561756 }
1757- case (ASR::cast_kindType::IntegerToInteger) : {
1757+ case (ASR::cast_kindType::IntegerToInteger) :
1758+ case (ASR::cast_kindType::UnsignedIntegerToUnsignedInteger) : {
17581759 // In C++, we do not need to cast int <-> long long explicitly:
1760+ // we also do not need to cast uint8_t <-> uint32_t explicitly:
17591761 // src = src;
17601762 break ;
17611763 }
Original file line number Diff line number Diff line change @@ -6876,7 +6876,8 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor<ASRToLLVMVisitor>
68766876 }
68776877 break ;
68786878 }
6879- case (ASR::cast_kindType::IntegerToInteger) : {
6879+ case (ASR::cast_kindType::IntegerToInteger) :
6880+ case (ASR::cast_kindType::UnsignedIntegerToUnsignedInteger) : {
68806881 int arg_kind = -1 , dest_kind = -1 ;
68816882 extract_kinds (x, arg_kind, dest_kind);
68826883 if ( arg_kind > 0 && dest_kind > 0 &&
Original file line number Diff line number Diff line change @@ -72,7 +72,8 @@ namespace CastingUtil {
7272 const std::map<ASR::ttypeType, ASR::cast_kindType>& kind_rules = {
7373 {ASR::ttypeType::Complex, ASR::cast_kindType::ComplexToComplex},
7474 {ASR::ttypeType::Real, ASR::cast_kindType::RealToReal},
75- {ASR::ttypeType::Integer, ASR::cast_kindType::IntegerToInteger}
75+ {ASR::ttypeType::Integer, ASR::cast_kindType::IntegerToInteger},
76+ {ASR::ttypeType::UnsignedInteger, ASR::cast_kindType::UnsignedIntegerToUnsignedInteger}
7677 };
7778
7879 int get_type_priority (ASR::ttypeType type) {
You can’t perform that action at this time.
0 commit comments