Skip to content

Commit 1798e93

Browse files
committed
Don't create _global_symbols if global_scope has no symbol
1 parent ba15bf1 commit 1798e93

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/libasr/pass/global_symbols.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ namespace LCompilers {
1717
void pass_wrap_global_syms_into_module(Allocator &al,
1818
ASR::TranslationUnit_t &unit,
1919
const LCompilers::PassOptions &/*pass_options*/) {
20+
if( unit.m_global_scope->get_scope().size() == 0 ) {
21+
return ;
22+
}
2023
Location loc = unit.base.base.loc;
2124
char *module_name = s2c(al, "_global_symbols");
2225
SymbolTable *module_scope = al.make_new<SymbolTable>(unit.m_global_scope);

0 commit comments

Comments
 (0)