diff options
author | Yuhan Deng <31569419+yhdengh@users.noreply.github.com> | 2021-11-30 14:04:40 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-30 22:04:40 +0000 |
commit | cf1e138ba9cde79d51f56d873e10b7ac9e4481b1 (patch) | |
tree | 22451a2d589797e4fd3c653e90ab7859234b38d0 /src/resolve-names.cc | |
parent | f65fadeedff3458e1dd9c157553cd0ed891683dd (diff) | |
download | wabt-cf1e138ba9cde79d51f56d873e10b7ac9e4481b1.tar.gz wabt-cf1e138ba9cde79d51f56d873e10b7ac9e4481b1.tar.bz2 wabt-cf1e138ba9cde79d51f56d873e10b7ac9e4481b1.zip |
Add multi-memory feature support (#1751)
Diffstat (limited to 'src/resolve-names.cc')
-rw-r--r-- | src/resolve-names.cc | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/resolve-names.cc b/src/resolve-names.cc index abd554ff..4c4c1495 100644 --- a/src/resolve-names.cc +++ b/src/resolve-names.cc @@ -51,13 +51,18 @@ class NameResolver : public ExprVisitor::DelegateNop { Result OnGlobalSetExpr(GlobalSetExpr*) override; Result BeginIfExpr(IfExpr*) override; Result EndIfExpr(IfExpr*) override; + Result OnLoadExpr(LoadExpr*) override; Result OnLocalGetExpr(LocalGetExpr*) override; Result OnLocalSetExpr(LocalSetExpr*) override; Result OnLocalTeeExpr(LocalTeeExpr*) override; Result BeginLoopExpr(LoopExpr*) override; Result EndLoopExpr(LoopExpr*) override; + Result OnMemoryCopyExpr(MemoryCopyExpr*) override; Result OnDataDropExpr(DataDropExpr*) override; + Result OnMemoryFillExpr(MemoryFillExpr*) override; + Result OnMemoryGrowExpr(MemoryGrowExpr*) override; Result OnMemoryInitExpr(MemoryInitExpr*) override; + Result OnMemorySizeExpr(MemorySizeExpr*) override; Result OnElemDropExpr(ElemDropExpr*) override; Result OnTableCopyExpr(TableCopyExpr*) override; Result OnTableInitExpr(TableInitExpr*) override; @@ -67,6 +72,7 @@ class NameResolver : public ExprVisitor::DelegateNop { Result OnTableSizeExpr(TableSizeExpr*) override; Result OnTableFillExpr(TableFillExpr*) override; Result OnRefFuncExpr(RefFuncExpr*) override; + Result OnStoreExpr(StoreExpr*) override; Result BeginTryExpr(TryExpr*) override; Result EndTryExpr(TryExpr*) override; Result OnThrowExpr(ThrowExpr*) override; @@ -321,6 +327,11 @@ Result NameResolver::EndIfExpr(IfExpr* expr) { return Result::Ok; } +Result NameResolver::OnLoadExpr(LoadExpr* expr) { + ResolveMemoryVar(&expr->memidx); + return Result::Ok; +} + Result NameResolver::OnLocalGetExpr(LocalGetExpr* expr) { ResolveLocalVar(&expr->var); return Result::Ok; @@ -336,13 +347,35 @@ Result NameResolver::OnLocalTeeExpr(LocalTeeExpr* expr) { return Result::Ok; } +Result NameResolver::OnMemoryCopyExpr(MemoryCopyExpr* expr) { + ResolveMemoryVar(&expr->srcmemidx); + ResolveMemoryVar(&expr->destmemidx); + return Result::Ok; +} + Result NameResolver::OnDataDropExpr(DataDropExpr* expr) { ResolveDataSegmentVar(&expr->var); return Result::Ok; } +Result NameResolver::OnMemoryFillExpr(MemoryFillExpr* expr) { + ResolveMemoryVar(&expr->memidx); + return Result::Ok; +} + +Result NameResolver::OnMemoryGrowExpr(MemoryGrowExpr* expr) { + ResolveMemoryVar(&expr->memidx); + return Result::Ok; +} + Result NameResolver::OnMemoryInitExpr(MemoryInitExpr* expr) { ResolveDataSegmentVar(&expr->var); + ResolveMemoryVar(&expr->memidx); + return Result::Ok; +} + +Result NameResolver::OnMemorySizeExpr(MemorySizeExpr* expr) { + ResolveMemoryVar(&expr->memidx); return Result::Ok; } @@ -393,6 +426,11 @@ Result NameResolver::OnRefFuncExpr(RefFuncExpr* expr) { return Result::Ok; } +Result NameResolver::OnStoreExpr(StoreExpr* expr) { + ResolveMemoryVar(&expr->memidx); + return Result::Ok; +} + Result NameResolver::BeginTryExpr(TryExpr* expr) { PushLabel(expr->block.label); ResolveBlockDeclarationVar(&expr->block.decl); |