@@ -568,9 +568,6 @@ class CommonVisitor : public AST::BaseVisitor<Struct> {
568568 Allocator &al;
569569 LocationManager &lm;
570570 SymbolTable *current_scope;
571- // The current_module contains the current module that is being visited;
572- // this is used to append to the module dependencies if needed
573- ASR::Module_t *current_module = nullptr ;
574571 SetChar current_module_dependencies;
575572 // True for the main module, false for every other one
576573 // The main module is stored directly in TranslationUnit, other modules are Modules
@@ -668,24 +665,7 @@ class CommonVisitor : public AST::BaseVisitor<Struct> {
668665 v = current_scope->get_symbol (sym);
669666 }
670667
671- // Now we need to add the module `m` with the intrinsic function
672- // into the current module dependencies
673- if (current_module) {
674- // We are in body visitor, the module is already constructed
675- // and available as current_module.
676- // Add the module `m` to current module dependencies
677- SetChar vec;
678- vec.from_pointer_n_copy (al, current_module->m_dependencies ,
679- current_module->n_dependencies );
680- vec.push_back (al, m->m_name );
681- current_module->m_dependencies = vec.p ;
682- current_module->n_dependencies = vec.size ();
683- } else {
684- // We are in the symtab visitor or body visitor and we are
685- // constructing a module, so current_module is not available yet
686- // (the current_module_dependencies is not used in body visitor)
687- current_module_dependencies.push_back (al, m->m_name );
688- }
668+ current_module_dependencies.push_back (al, m->m_name );
689669 return v;
690670 }
691671
0 commit comments