-
Notifications
You must be signed in to change notification settings - Fork 171
Sync libasr
from LFortran
#1670
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
cf9ae06
to
b2186ca
Compare
For |
src/libasr/alloc.h
Outdated
#ifdef LCOMPILERS_FAST_ALLOC | ||
try { | ||
#endif | ||
LCOMPILERS_ASSERT(start != nullptr); | ||
size_t addr = current_pos; | ||
current_pos += align(s); | ||
if (size_current() > size_total()) throw std::bad_alloc(); | ||
if (size_current() > size_total()) { | ||
#ifdef LCOMPILERS_FAST_ALLOC | ||
throw std::bad_alloc(); | ||
#else | ||
return new_chunk(s); | ||
#endif | ||
} | ||
return (void*)addr; | ||
#ifdef LCOMPILERS_FAST_ALLOC | ||
} catch (const std::bad_alloc &e) { | ||
return new_chunk(s); | ||
} | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think, this can be reverted for now. We can add it later when building lpython
to wasm
in release mode.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry about this. LFortran needs it. Let's add it in LPython as well. (I assumed we could diverge here slightly and later make them same. Maybe its better to have equal LibASRs.)
src/libasr/codegen/asr_to_julia.cpp
Outdated
for (size_t idx=0; idx < s.size(); idx++) { | ||
src += s[idx]; | ||
for (size_t idx = 0; idx < s.size(); idx++) { | ||
if (s[idx] == '\n') { | ||
src += "\\n"; | ||
} else if (s[idx] == '\\') { | ||
src += "\\\\"; | ||
} else if (s[idx] == '\"') { | ||
src += "\\\""; | ||
} else { | ||
src += s[idx]; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this needs to be reverted. Please see 3c53ffb.
src/libasr/codegen/asr_to_x86.cpp
Outdated
std::vector<std::string> build_order = ASRUtils::determine_module_dependencies(x); | ||
for (auto &item : build_order) { | ||
ASR::symbol_t *mod = x.m_global_scope->get_symbol(item); | ||
visit_symbol(*mod); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this needs to be reverted (39aed26).
src/libasr/codegen/asr_to_x86.cpp
Outdated
void visit_Module(const ASR::Module_t &x) { | ||
std::vector<std::string> func_order | ||
= ASRUtils::determine_function_definition_order(x.m_symtab); | ||
for (size_t i = 0; i < func_order.size(); i++) { | ||
ASR::symbol_t* sym = x.m_symtab->get_symbol(func_order[i]); | ||
// Ignore external symbols because they are already defined by the loop above. | ||
if( !sym || ASR::is_a<ASR::ExternalSymbol_t>(*sym) ) { | ||
continue; | ||
} | ||
visit_symbol(*sym); | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to be reverted (39aed26)
Looks good here in the generics department. |
src/libasr/pass/pass_list_expr.cpp
Outdated
std::string list_type_name = ASRUtils::get_type_code(list_type, true); | ||
std::string list_type_name = ASRUtils::type_to_str_python(list_type); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this needs to be reverted. Please see a166236.
src/libasr/pass/pass_list_expr.cpp
Outdated
std::string list_type_name = ASRUtils::get_type_code(x->m_type, true); | ||
std::string list_type_name = ASRUtils::type_to_str_python(x->m_type); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to be reverted. (a166236)
src/libasr/pass/pass_list_expr.cpp
Outdated
std::string list_type_name = ASRUtils::get_type_code(list_type, true); | ||
std::string list_type_name = ASRUtils::type_to_str_python(list_type); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similarly, here (a166236)
src/libasr/pass/pass_list_expr.cpp
Outdated
std::string list_type_name = ASRUtils::get_type_code(x->m_type, true); | ||
std::string list_type_name = ASRUtils::type_to_str_python(x->m_type); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similarly here (a166236)
src/libasr/codegen/asr_to_llvm.cpp
Outdated
llvm::Value* lfortran_str_item(llvm::Value* str, llvm::Value* idx1) | ||
llvm::Value* lfortran_str_copy(llvm::Value* str, llvm::Value* idx1, llvm::Value* idx2) | ||
{ | ||
std::string runtime_func_name = "_lfortran_str_item"; | ||
std::string runtime_func_name = "_lfortran_str_copy"; | ||
llvm::Function *fn = module->getFunction(runtime_func_name); | ||
if (!fn) { | ||
llvm::FunctionType *function_type = llvm::FunctionType::get( | ||
character_type, { | ||
character_type, llvm::Type::getInt32Ty(context) | ||
character_type, llvm::Type::getInt32Ty(context), llvm::Type::getInt32Ty(context) | ||
}, false); | ||
fn = llvm::Function::Create(function_type, | ||
llvm::Function::ExternalLinkage, runtime_func_name, *module); | ||
} | ||
return builder->CreateCall(fn, {str, idx1}); | ||
return builder->CreateCall(fn, {str, idx1, idx2}); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this needs to be reverted. Please see 2f45421.
src/libasr/codegen/asr_to_llvm.cpp
Outdated
p = lfortran_str_item(str, idx); | ||
p = lfortran_str_copy(str, idx, idx); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to be reverted (2f45421)
src/libasr/codegen/asr_to_llvm.cpp
Outdated
llvm::Value *step = llvm::ConstantInt::get(context, llvm::APInt(32, 1)); | ||
llvm::Value *present = llvm::ConstantInt::get(context, llvm::APInt(1, 1)); | ||
llvm::Value *p = lfortran_str_slice(str, idx1, idx2, step, present, present); | ||
llvm::Value *p = lfortran_str_copy(str, idx1, idx2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to be reverted (2f45421)
src/libasr/codegen/asr_to_llvm.cpp
Outdated
tmp = lfortran_str_item(str, idx); | ||
tmp = lfortran_str_copy(str, idx, idx); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to be reverted (2f45421).
src/libasr/codegen/asr_to_llvm.cpp
Outdated
// std::cout << LPython::pickle(asr, true, true, true) << std::endl; | ||
// std::cout << LFortran::pickle(asr, true, true, true) << std::endl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be reverted.
I guess we missed to include |
def visit_BaseWASMVisitor(self, mod, *args): | ||
def visitWASMInstructions(self, mod, *args): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This whole file needs to be reverted. Please see my comment here #1670 (comment).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did and now I am getting the following errors,
Consolidate compiler generated dependencies of target asr
[ 1%] Building CXX object src/libasr/CMakeFiles/asr.dir/codegen/wasm_to_wat.cpp.o
In file included from /Users/czgdp1807/lpython_project/lpython/src/libasr/codegen/wasm_to_wat.cpp:5:
In file included from /Users/czgdp1807/lpython_project/lpython/src/libasr/../libasr/codegen/wasm_to_wat.h:4:
/Users/czgdp1807/lpython_project/lpython/src/libasr/../libasr/wasm_visitor.h:2794:15: error: no member named 'emit_u32' in namespace 'LCompilers::wasm'
wasm::emit_u32(m_code, m_al, labelidx);
~~~~~~^
/Users/czgdp1807/lpython_project/lpython/src/libasr/../libasr/wasm_visitor.h:2799:15: error: no member named 'emit_u32' in namespace 'LCompilers::wasm'
wasm::emit_u32(m_code, m_al, labelidx);
~~~~~~^
/Users/czgdp1807/lpython_project/lpython/src/libasr/../libasr/wasm_visitor.h:2808:15: error: no member named 'emit_u32' in namespace 'LCompilers::wasm'
wasm::emit_u32(m_code, m_al, funcidx);
~~~~~~^
/Users/czgdp1807/lpython_project/lpython/src/libasr/../libasr/wasm_visitor.h:2813:15: error: no member named 'emit_u32' in namespace 'LCompilers::wasm'
wasm::emit_u32(m_code, m_al, typeidx);
~~~~~~^
/Users/czgdp1807/lpython_project/lpython/src/libasr/../libasr/wasm_visitor.h:2814:15: error: no member named 'emit_u32' in namespace 'LCompilers::wasm'
wasm::emit_u32(m_code, m_al, tableidx);
~~~~~~^
/Users/czgdp1807/lpython_project/lpython/src/libasr/../libasr/wasm_visitor.h:2819:15: error: no member named 'emit_b8' in namespace 'LCompilers::wasm'
wasm::emit_b8(m_code, m_al, reftype);
~~~~~~^
/Users/czgdp1807/lpython_project/lpython/src/libasr/../libasr/wasm_visitor.h:2828:15: error: no member named 'emit_u32' in namespace 'LCompilers::wasm'
wasm::emit_u32(m_code, m_al, funcidx);
~~~~~~^
/Users/czgdp1807/lpython_project/lpython/src/libasr/../libasr/wasm_visitor.h:2841:15: error: no member named 'emit_u32' in namespace 'LCompilers::wasm'
wasm::emit_u32(m_code, m_al, localidx);
~~~~~~^
/Users/czgdp1807/lpython_project/lpython/src/libasr/../libasr/wasm_visitor.h:2846:15: error: no member named 'emit_u32' in namespace 'LCompilers::wasm'
wasm::emit_u32(m_code, m_al, localidx);
~~~~~~^
/Users/czgdp1807/lpython_project/lpython/src/libasr/../libasr/wasm_visitor.h:2851:15: error: no member named 'emit_u32' in namespace 'LCompilers::wasm'
wasm::emit_u32(m_code, m_al, localidx);
~~~~~~^
/Users/czgdp1807/lpython_project/lpython/src/libasr/../libasr/wasm_visitor.h:2856:15: error: no member named 'emit_u32' in namespace 'LCompilers::wasm'
wasm::emit_u32(m_code, m_al, globalidx);
~~~~~~^
/Users/czgdp1807/lpython_project/lpython/src/libasr/../libasr/wasm_visitor.h:2861:15: error: no member named 'emit_u32' in namespace 'LCompilers::wasm'
wasm::emit_u32(m_code, m_al, globalidx);
~~~~~~^
/Users/czgdp1807/lpython_project/lpython/src/libasr/../libasr/wasm_visitor.h:2866:15: error: no member named 'emit_u32' in namespace 'LCompilers::wasm'
wasm::emit_u32(m_code, m_al, tableidx);
~~~~~~^
/Users/czgdp1807/lpython_project/lpython/src/libasr/../libasr/wasm_visitor.h:2871:15: error: no member named 'emit_u32' in namespace 'LCompilers::wasm'
wasm::emit_u32(m_code, m_al, tableidx);
~~~~~~^
/Users/czgdp1807/lpython_project/lpython/src/libasr/../libasr/wasm_visitor.h:2876:15: error: no member named 'emit_u32' in namespace 'LCompilers::wasm'
wasm::emit_u32(m_code, m_al, mem_align);
~~~~~~^
/Users/czgdp1807/lpython_project/lpython/src/libasr/../libasr/wasm_visitor.h:2877:15: error: no member named 'emit_u32' in namespace 'LCompilers::wasm'
wasm::emit_u32(m_code, m_al, mem_offset);
~~~~~~^
/Users/czgdp1807/lpython_project/lpython/src/libasr/../libasr/wasm_visitor.h:2882:15: error: no member named 'emit_u32' in namespace 'LCompilers::wasm'
wasm::emit_u32(m_code, m_al, mem_align);
~~~~~~^
/Users/czgdp1807/lpython_project/lpython/src/libasr/../libasr/wasm_visitor.h:2883:15: error: no member named 'emit_u32' in namespace 'LCompilers::wasm'
wasm::emit_u32(m_code, m_al, mem_offset);
~~~~~~^
/Users/czgdp1807/lpython_project/lpython/src/libasr/../libasr/wasm_visitor.h:2888:15: error: no member named 'emit_u32' in namespace 'LCompilers::wasm'
wasm::emit_u32(m_code, m_al, mem_align);
~~~~~~^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[2]: *** [src/libasr/CMakeFiles/asr.dir/build.make:174: src/libasr/CMakeFiles/asr.dir/codegen/wasm_to_wat.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:287: src/libasr/CMakeFiles/asr.dir/all] Error 2
make: *** [Makefile:166: all] Error 2
(lp) 15:18:20:~/lpython_project/lpython % ./build0.sh
+ ci/version.sh
++ git describe --tags --dirty
+ version=v0.12.0-239-gb35e744dc-dirty
+ version=0.12.0-239-gb35e744dc-dirty
+ echo 0.12.0-239-gb35e744dc-dirty
+ python grammar/asdl_py.py
Assuming default values of Python.asdl and python_ast.py
+ python src/libasr/asdl_cpp.py grammar/Python.asdl src/lpython/python_ast.h
+ python src/libasr/asdl_cpp.py src/libasr/ASR.asdl src/libasr/asr.h
+ python src/libasr/wasm_instructions_visitor.py
Assuming default values of wasm_instructions.txt and wasm_visitor.h
+ cd src/lpython/parser
+ re2c -W -b tokenizer.re -o tokenizer.cpp
+ cd src/lpython/parser
+ bison -Wall -d -r all parser.yy
+ grep -n ''\''' src/lpython/parser/parser.yy
+ echo OK
OK
(lp) 15:18:46:~/lpython_project/lpython % make
Consolidate compiler generated dependencies of target asr
[ 1%] Building CXX object src/libasr/CMakeFiles/asr.dir/codegen/asr_to_cpp.cpp.o
[ 2%] Building CXX object src/libasr/CMakeFiles/asr.dir/codegen/asr_to_c.cpp.o
[ 3%] Building CXX object src/libasr/CMakeFiles/asr.dir/codegen/asr_to_julia.cpp.o
[ 4%] Building CXX object src/libasr/CMakeFiles/asr.dir/codegen/asr_to_py.cpp.o
[ 5%] Building CXX object src/libasr/CMakeFiles/asr.dir/codegen/asr_to_x86.cpp.o
[ 7%] Building CXX object src/libasr/CMakeFiles/asr.dir/codegen/asr_to_wasm.cpp.o
[ 8%] Building CXX object src/libasr/CMakeFiles/asr.dir/codegen/wasm_to_wat.cpp.o
In file included from /Users/czgdp1807/lpython_project/lpython/src/libasr/codegen/wasm_to_wat.cpp:5:
In file included from /Users/czgdp1807/lpython_project/lpython/src/libasr/../libasr/codegen/wasm_to_wat.h:4:
/Users/czgdp1807/lpython_project/lpython/src/libasr/../libasr/wasm_visitor.h:2794:15: error: no member named 'emit_u32' in namespace 'LCompilers::wasm'
wasm::emit_u32(m_code, m_al, labelidx);
~~~~~~^
/Users/czgdp1807/lpython_project/lpython/src/libasr/../libasr/wasm_visitor.h:2799:15: error: no member named 'emit_u32' in namespace 'LCompilers::wasm'
wasm::emit_u32(m_code, m_al, labelidx);
~~~~~~^
/Users/czgdp1807/lpython_project/lpython/src/libasr/../libasr/wasm_visitor.h:2808:15: error: no member named 'emit_u32' in namespace 'LCompilers::wasm'
wasm::emit_u32(m_code, m_al, funcidx);
~~~~~~^
/Users/czgdp1807/lpython_project/lpython/src/libasr/../libasr/wasm_visitor.h:2813:15: error: no member named 'emit_u32' in namespace 'LCompilers::wasm'
wasm::emit_u32(m_code, m_al, typeidx);
~~~~~~^
/Users/czgdp1807/lpython_project/lpython/src/libasr/../libasr/wasm_visitor.h:2814:15: error: no member named 'emit_u32' in namespace 'LCompilers::wasm'
wasm::emit_u32(m_code, m_al, tableidx);
~~~~~~^
/Users/czgdp1807/lpython_project/lpython/src/libasr/../libasr/wasm_visitor.h:2819:15: error: no member named 'emit_b8' in namespace 'LCompilers::wasm'
wasm::emit_b8(m_code, m_al, reftype);
~~~~~~^
/Users/czgdp1807/lpython_project/lpython/src/libasr/../libasr/wasm_visitor.h:2828:15: error: no member named 'emit_u32' in namespace 'LCompilers::wasm'
wasm::emit_u32(m_code, m_al, funcidx);
~~~~~~^
/Users/czgdp1807/lpython_project/lpython/src/libasr/../libasr/wasm_visitor.h:2841:15: error: no member named 'emit_u32' in namespace 'LCompilers::wasm'
wasm::emit_u32(m_code, m_al, localidx);
~~~~~~^
/Users/czgdp1807/lpython_project/lpython/src/libasr/../libasr/wasm_visitor.h:2846:15: error: no member named 'emit_u32' in namespace 'LCompilers::wasm'
wasm::emit_u32(m_code, m_al, localidx);
~~~~~~^
/Users/czgdp1807/lpython_project/lpython/src/libasr/../libasr/wasm_visitor.h:2851:15: error: no member named 'emit_u32' in namespace 'LCompilers::wasm'
wasm::emit_u32(m_code, m_al, localidx);
~~~~~~^
/Users/czgdp1807/lpython_project/lpython/src/libasr/../libasr/wasm_visitor.h:2856:15: error: no member named 'emit_u32' in namespace 'LCompilers::wasm'
wasm::emit_u32(m_code, m_al, globalidx);
~~~~~~^
/Users/czgdp1807/lpython_project/lpython/src/libasr/../libasr/wasm_visitor.h:2861:15: error: no member named 'emit_u32' in namespace 'LCompilers::wasm'
wasm::emit_u32(m_code, m_al, globalidx);
~~~~~~^
/Users/czgdp1807/lpython_project/lpython/src/libasr/../libasr/wasm_visitor.h:2866:15: error: no member named 'emit_u32' in namespace 'LCompilers::wasm'
wasm::emit_u32(m_code, m_al, tableidx);
~~~~~~^
/Users/czgdp1807/lpython_project/lpython/src/libasr/../libasr/wasm_visitor.h:2871:15: error: no member named 'emit_u32' in namespace 'LCompilers::wasm'
wasm::emit_u32(m_code, m_al, tableidx);
~~~~~~^
/Users/czgdp1807/lpython_project/lpython/src/libasr/../libasr/wasm_visitor.h:2876:15: error: no member named 'emit_u32' in namespace 'LCompilers::wasm'
wasm::emit_u32(m_code, m_al, mem_align);
~~~~~~^
/Users/czgdp1807/lpython_project/lpython/src/libasr/../libasr/wasm_visitor.h:2877:15: error: no member named 'emit_u32' in namespace 'LCompilers::wasm'
wasm::emit_u32(m_code, m_al, mem_offset);
~~~~~~^
/Users/czgdp1807/lpython_project/lpython/src/libasr/../libasr/wasm_visitor.h:2882:15: error: no member named 'emit_u32' in namespace 'LCompilers::wasm'
wasm::emit_u32(m_code, m_al, mem_align);
~~~~~~^
/Users/czgdp1807/lpython_project/lpython/src/libasr/../libasr/wasm_visitor.h:2883:15: error: no member named 'emit_u32' in namespace 'LCompilers::wasm'
wasm::emit_u32(m_code, m_al, mem_offset);
~~~~~~^
/Users/czgdp1807/lpython_project/lpython/src/libasr/../libasr/wasm_visitor.h:2888:15: error: no member named 'emit_u32' in namespace 'LCompilers::wasm'
wasm::emit_u32(m_code, m_al, mem_align);
~~~~~~^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[2]: *** [src/libasr/CMakeFiles/asr.dir/build.make:174: src/libasr/CMakeFiles/asr.dir/codegen/wasm_to_wat.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:287: src/libasr/CMakeFiles/asr.dir/all] Error 2
make: *** [Makefile:166: all] Error 2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolved. Thanks.
The rest looks good to me. Thank you so much for this PR. |
// idx starts from 1 | ||
LFORTRAN_API char* _lfortran_str_item(char* s, int32_t idx) { | ||
// idx1 and idx2 both start from 1 | ||
LFORTRAN_API char* _lfortran_str_copy(char* s, int32_t idx1, int32_t idx2) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs to be reverted 2f45421
I guess change of |
They are already there in this PR. |
The commit you have mentioned is a very old one. |
@@ -85,7 +85,7 @@ class PrintArrVisitor : public PassUtils::PassVisitor<PrintArrVisitor> | |||
doloop_body.push_back(al, doloop); | |||
doloop_body.push_back(al, empty_print_endl); | |||
} | |||
doloop = ASRUtils::STMT(ASR::make_DoLoop_t(al, loc, head, doloop_body.p, doloop_body.size())); | |||
doloop = ASRUtils::STMT(ASR::make_DoLoop_t(al, loc, nullptr, head, doloop_body.p, doloop_body.size())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes in pass/print_arr.cpp
are missing, lfortran/lfortran@b1992c3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, I shared here #1670 (comment).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, that's a very old commit. I just copied today mornings main
from lfortran
into lpython
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is there in the latest main as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. I added it in this PR.
Please consider the We now copy these files from |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One or two commits are missing, rest all look good to me. Thanks for syncing!
b2186ca
to
b6af4d9
Compare
@Shaikh-Ubaid WASM fails on CI. Could you please take a look? 17/33 Test #22: test_complex_01 ..................***Failed 0.28 sec
(node:15485) ExperimentalWarning: WASI is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
node:internal/process/promises:288
triggerUncaughtException(err, true /* fromPromise */);
^
[CompileError: WebAssembly.compile(): Compiling function #15 failed: function index #4294967295 is out of bounds @+2470] |
src/libasr/codegen/asr_to_x86.cpp
Outdated
ASR::Function_t *s = ASR::down_cast<ASR::Function_t>( | ||
ASRUtils::symbol_get_past_external(x.m_name)); | ||
ASR::Function_t *s = ASR::down_cast<ASR::Function_t>(x.m_name); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think/guess this needs to be reverted (39aed26).
ec46820
to
85eadac
Compare
src/libasr/codegen/asr_to_llvm.cpp
Outdated
std::string s = unescape_string(al, x.m_s); | ||
tmp = builder->CreateGlobalStringPtr(s); | ||
tmp = builder->CreateGlobalStringPtr(x.m_s); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be reverted, I think. Can you please add this LFortran as well!
src/libasr/codegen/asr_to_llvm.cpp
Outdated
ASR::StructType_t* der_type = ASR::down_cast<ASR::StructType_t>( | ||
ASRUtils::symbol_get_past_external(der->m_derived_type)); | ||
ASR::Struct_t* der = (ASR::Struct_t*)(&(x->m_type->base)); | ||
ASR::StructType_t* der_type = (ASR::StructType_t*)(&(der->m_derived_type->base)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from the above changes. I think this looks good to go in.
Thank you very much!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for doing this!
f9b5028
to
6ecf957
Compare
src/libasr/codegen/asr_to_llvm.cpp
Outdated
ASR::Class_t* der = ASR::down_cast<ASR::Class_t>(x->m_type); | ||
ASR::ClassType_t* der_type = ASR::down_cast<ASR::ClassType_t>( | ||
ASRUtils::symbol_get_past_external(der->m_class_type)); | ||
ASR::Class_t* der = (ASR::Class_t*)(&(x->m_type->base)); | ||
ASR::ClassType_t* der_type = (ASR::ClassType_t*)(&(der->m_class_type->base)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I didn't mention this earlier. Can you please revert this as well.
6ecf957
to
a662011
Compare
Co-authored-by: Shaikh Ubaid <[email protected]>
a662011
to
43b0188
Compare
Corresponding LFortran PR - lfortran/lfortran#1501