Skip to content

Commit e653003

Browse files
committed
Implemented type encoding for Const
1 parent ad2d806 commit e653003

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/libasr/asr_utils.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -807,6 +807,13 @@ static inline std::string get_type_code(const ASR::ttype_t *t, bool use_undersco
807807
}
808808
return "Pointer[" + get_type_code(p->m_type, use_underscore_sep, encode_dimensions_) + "]";
809809
}
810+
case ASR::ttypeType::Const: {
811+
ASR::Const_t* p = ASR::down_cast<ASR::Const_t>(t);
812+
if( use_underscore_sep ) {
813+
return "Const_" + get_type_code(p->m_type, use_underscore_sep, encode_dimensions_) + "_";
814+
}
815+
return "Const[" + get_type_code(p->m_type, use_underscore_sep, encode_dimensions_) + "]";
816+
}
810817
default: {
811818
throw LCompilersException("Type encoding not implemented for "
812819
+ std::to_string(t->type));

0 commit comments

Comments
 (0)