Skip to content

Added support for multi-memory in apply-names - #1810

Merged
sbc100 merged 3 commits into
WebAssembly:mainfrom
fix-project:main
Feb 17, 2022
Merged

sbc100 merged 3 commits into
WebAssembly:mainfrom
fix-project:main

Conversation

@yhdengh

@yhdengh yhdengh commented Jan 20, 2022

Copy link
Copy Markdown
Contributor

This PR adds support for the multi-memory proposal in apply-names.cc. This change should have been part of #1751, but I didn't realize that this change is necessary.

This PR also adds name application to all exports. The current main branch only applies names if the export is of type func, but I think it should also apply names for global, table, memory, and tag. Is there any specific reason for only applying names to funcs?

@sbc100 sbc100 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

lgtm % testing comment

Comment thread src/apply-names.cc

Result NameApplier::OnMemoryCopyExpr(MemoryCopyExpr* expr) {
CHECK_RESULT(UseNameForMemoryVar(&expr->srcmemidx));
CHECK_RESULT(UseNameForMemoryVar(&expr->destmemidx));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we write a test (or add to an existing test) to show that this working?

@@ -0,0 +1,25 @@
;;; TOOL: run-roundtrip

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about calling this apply-memory-names.txt to match the existing apply-global-names.txt

@sbc100
sbc100 merged commit a8f401d into WebAssembly:main Feb 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants