Skip to content

Commit 0738b54

Browse files
committed
LLVM: Support global unsigned int variables
1 parent f8f58d0 commit 0738b54

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/libasr/codegen/asr_to_llvm.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -2353,8 +2353,9 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor<ASRToLLVMVisitor>
23532353
this->visit_expr_wrapper(x.m_symbolic_value, true);
23542354
init_value = llvm::dyn_cast<llvm::Constant>(tmp);
23552355
}
2356-
if (x.m_type->type == ASR::ttypeType::Integer) {
2357-
int a_kind = down_cast<ASR::Integer_t>(x.m_type)->m_kind;
2356+
if (x.m_type->type == ASR::ttypeType::Integer
2357+
|| x.m_type->type == ASR::ttypeType::UnsignedInteger) {
2358+
int a_kind = ASRUtils::extract_kind_from_ttype_t(x.m_type);
23582359
llvm::Type *type;
23592360
int init_value_bits = 8*a_kind;
23602361
type = llvm_utils->getIntType(a_kind);

0 commit comments

Comments
 (0)