Skip to content

Commit

Permalink
Don't create _global_symbols if global_scope has no symbol
Browse files Browse the repository at this point in the history
  • Loading branch information
czgdp1807 committed Apr 21, 2023
1 parent ba15bf1 commit 1798e93
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/libasr/pass/global_symbols.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ namespace LCompilers {
void pass_wrap_global_syms_into_module(Allocator &al,
ASR::TranslationUnit_t &unit,
const LCompilers::PassOptions &/*pass_options*/) {
if( unit.m_global_scope->get_scope().size() == 0 ) {
return ;
}
Location loc = unit.base.base.loc;
char *module_name = s2c(al, "_global_symbols");
SymbolTable *module_scope = al.make_new<SymbolTable>(unit.m_global_scope);
Expand Down

0 comments on commit 1798e93

Please sign in to comment.