File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2738,9 +2738,11 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor<ASRToLLVMVisitor>
27382738 llvm::StructType* array_type = static_cast <llvm::StructType*>(
27392739 llvm_utils->get_type_from_ttype_t_util (x.m_type , module .get ()));
27402740 llvm::Constant *ptr = module ->getOrInsertGlobal (x.m_name , array_type);
2741- module ->getNamedGlobal (x.m_name )->setInitializer (
2742- llvm::ConstantStruct::get (array_type,
2743- llvm::Constant::getNullValue (array_type)));
2741+ if (!external) {
2742+ module ->getNamedGlobal (x.m_name )->setInitializer (
2743+ llvm::ConstantStruct::get (array_type,
2744+ llvm::Constant::getNullValue (array_type)));
2745+ }
27442746 llvm_symtab[h] = ptr;
27452747 } else if (x.m_type ->type == ASR::ttypeType::Logical) {
27462748 llvm::Constant *ptr = module ->getOrInsertGlobal (x.m_name ,
You can’t perform that action at this time.
0 commit comments