Skip to content

Commit d4a6d53

Browse files
authored
Merge pull request #1274 from Shaikh-Ubaid/wasm_modules_initial
Wasm modules initial
2 parents 89e74c5 + 0dd9a03 commit d4a6d53

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed

integration_tests/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,8 @@ RUN(NAME test_dict_03 LABELS cpython llvm)
197197
RUN(NAME test_dict_04 LABELS cpython llvm)
198198
RUN(NAME test_dict_05 LABELS cpython llvm)
199199
RUN(NAME test_for_loop LABELS cpython llvm c)
200-
RUN(NAME modules_01 LABELS cpython llvm)
201-
RUN(NAME modules_02 LABELS cpython llvm)
200+
RUN(NAME modules_01 LABELS cpython llvm wasm)
201+
RUN(NAME modules_02 LABELS cpython llvm wasm)
202202
RUN(NAME test_import_01 LABELS cpython llvm)
203203
RUN(NAME test_math LABELS cpython llvm)
204204
RUN(NAME test_numpy_01 LABELS cpython llvm c)

src/libasr/codegen/asr_to_wasm.cpp

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -264,13 +264,11 @@ class ASRToWASMVisitor : public ASR::BaseVisitor<ASRToWASMVisitor> {
264264
for (auto &item : build_order) {
265265
LFORTRAN_ASSERT(x.m_global_scope->get_scope().find(item) !=
266266
x.m_global_scope->get_scope().end());
267-
if (startswith(item, "lfortran_intrinsic")) {
268-
ASR::symbol_t *mod = x.m_global_scope->get_symbol(item);
269-
if (ASR::is_a<ASR::Module_t>(*mod)) {
270-
ASR::Module_t *m =
271-
ASR::down_cast<ASR::Module_t>(mod);
272-
declare_all_functions(*(m->m_symtab));
273-
}
267+
ASR::symbol_t *mod = x.m_global_scope->get_symbol(item);
268+
if (ASR::is_a<ASR::Module_t>(*mod)) {
269+
ASR::Module_t *m =
270+
ASR::down_cast<ASR::Module_t>(mod);
271+
declare_all_functions(*(m->m_symtab));
274272
}
275273
}
276274

@@ -296,10 +294,8 @@ class ASRToWASMVisitor : public ASR::BaseVisitor<ASRToWASMVisitor> {
296294
for (auto &item : build_order) {
297295
LFORTRAN_ASSERT(x.m_global_scope->get_scope().find(item) !=
298296
x.m_global_scope->get_scope().end());
299-
if (startswith(item, "lfortran_intrinsic")) {
300-
ASR::symbol_t *mod = x.m_global_scope->get_symbol(item);
301-
this->visit_symbol(*mod);
302-
}
297+
ASR::symbol_t *mod = x.m_global_scope->get_symbol(item);
298+
this->visit_symbol(*mod);
303299
}
304300
}
305301

0 commit comments

Comments
 (0)