Skip to content
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

Add functions to expose module import/export info #3330

Merged
merged 3 commits into from
Apr 20, 2024

Conversation

bnason-nf
Copy link
Contributor

@bnason-nf bnason-nf commented Apr 17, 2024

Resolves #3329.

const char * module_name;
const char * name;
wasm_import_export_kind_t kind;
bool linked;
Copy link
Collaborator

Choose a reason for hiding this comment

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

May I ask why linked is required here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's useful for informational purposes, it allows me to tell when I've properly provided all of the necessary imports by checking that they show up as linked.

@lum1n0us
Copy link
Collaborator

Modification doesn't cover if input is AOT file. Need something like https://github.com/bytecodealliance/wasm-micro-runtime/blob/main/core/iwasm/common/wasm_runtime_common.c#L1345C4-L1345C63 to handle both .wasm and .aot

Should address suggestions from @lum1n0us.
@bnason-nf
Copy link
Contributor Author

Thanks for the review @lum1n0us, I made a new commit that I think should address all of your comments. Please let me know if there's anything else.

core/iwasm/include/wasm_export.h Outdated Show resolved Hide resolved
core/iwasm/include/wasm_export.h Outdated Show resolved Hide resolved
core/iwasm/include/wasm_export.h Outdated Show resolved Hide resolved
core/iwasm/include/wasm_export.h Outdated Show resolved Hide resolved
core/iwasm/include/wasm_export.h Outdated Show resolved Hide resolved
core/iwasm/common/wasm_runtime_common.c Outdated Show resolved Hide resolved
core/iwasm/common/wasm_runtime_common.c Outdated Show resolved Hide resolved
core/iwasm/common/wasm_runtime_common.c Outdated Show resolved Hide resolved
core/iwasm/common/wasm_runtime_common.c Outdated Show resolved Hide resolved
core/iwasm/common/wasm_runtime_common.c Outdated Show resolved Hide resolved
@wenyongh
Copy link
Contributor

Thanks for the review @lum1n0us, I made a new commit that I think should address all of your comments. Please let me know if there's anything else.

@bnason-nf I added some comments which are mainly for coding styles, could you help make changes again? Thanks.

@bnason-nf
Copy link
Contributor Author

Thanks @wenyongh, I think I addressed all of your suggestions. Please let me know if I missed anything.

@bnason-nf
Copy link
Contributor Author

Just out of curiosity, is there a reason that clang-format is explicitly turned off in wasm-export.h?

Copy link
Contributor

@wenyongh wenyongh left a comment

Choose a reason for hiding this comment

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

LGTM

@wenyongh wenyongh merged commit 8253c41 into bytecodealliance:main Apr 20, 2024
386 checks passed
@bnason-nf bnason-nf deleted the import-export-info branch April 20, 2024 01:08
@wenyongh
Copy link
Contributor

Thanks @wenyongh, I think I addressed all of your suggestions. Please let me know if I missed anything.

Thanks a lot, it looks much better now, I merged the PR.

Just out of curiosity, is there a reason that clang-format is explicitly turned off in wasm-export.h?

There are some long line comments in wasm_export.h and /* clang-format off */ was added to disable clang-format, but I think it should not be a reason, we had better enable clang-format for it to make the coding style look better and be consistent with other files. I updated PR #3327 to fix it.

victoryang00 pushed a commit to victoryang00/wamr-aot-gc-checkpoint-restore that referenced this pull request May 1, 2024
victoryang00 pushed a commit to victoryang00/wamr-aot-gc-checkpoint-restore that referenced this pull request May 2, 2024
victoryang00 pushed a commit to victoryang00/wamr-aot-gc-checkpoint-restore that referenced this pull request May 27, 2024
victoryang00 pushed a commit to victoryang00/wamr-aot-gc-checkpoint-restore that referenced this pull request May 27, 2024
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.

Add ability to get import and export information from wasm_export interface
3 participants