Skip to content

Commit

Permalink
WASM: Support visit_StringLen()
Browse files Browse the repository at this point in the history
  • Loading branch information
Shaikh-Ubaid committed Aug 1, 2023
1 parent 1180f99 commit 6f7e7f5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/libasr/codegen/asr_to_wasm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1935,6 +1935,15 @@ class ASRToWASMVisitor : public ASR::BaseVisitor<ASRToWASMVisitor> {
throw CodeGenError("String Types not yet supported");
}

void visit_StringLen(const ASR::StringLen_t & x) {
if (x.m_value) {
visit_expr(*x.m_value);
return;
}
this->visit_expr(*x.m_arg);
m_wa.emit_i32_load(wasm::mem_align::b8, 4);
}

void visit_LogicalBinOp(const ASR::LogicalBinOp_t &x) {
if (x.m_value) {
visit_expr(*x.m_value);
Expand Down

0 comments on commit 6f7e7f5

Please sign in to comment.