Stream: git-wasmtime

Topic: wasmtime / issue #5654 Make `FunctionBuilder::is_pristine...


view this post on Zulip Wasmtime GitHub notifications bot (Jan 30 2023 at 19:16):

ptitSeb opened issue #5654:

Thanks for filing a feature request! Please fill out the TODOs below.

Feature

With Cranelift 0.90, FunctionBuilder::is_pristine(...) is private and not public.
Is there a way to know if a block is empty or not?

Benefit

For example knowing if an Else branch of an If exist or not.

Implementation

Make the current function public

Alternatives

I don't see any practical alternative

view this post on Zulip Wasmtime GitHub notifications bot (Jan 30 2023 at 20:26):

jameysharp commented on issue #5654:

I believe this should work as an alternative:

let current_block = builder.current_block();
let is_pristine = builder.func.layout.first_inst(current_block).is_none();

Does that work for you?

view this post on Zulip Wasmtime GitHub notifications bot (Jan 30 2023 at 20:52):

ptitSeb commented on issue #5654:

Probably, I'll check that. Thanks.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 01 2023 at 01:04):

jameysharp commented on issue #5654:

Feel free to re-open this issue if that doesn't work for you, and until then I'll go ahead and close this.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 01 2023 at 01:05):

jameysharp closed issue #5654:

Thanks for filing a feature request! Please fill out the TODOs below.

Feature

With Cranelift 0.90, FunctionBuilder::is_pristine(...) is private and not public.
Is there a way to know if a block is empty or not?

Benefit

For example knowing if an Else branch of an If exist or not.

Implementation

Make the current function public

Alternatives

I don't see any practical alternative

view this post on Zulip Wasmtime GitHub notifications bot (Feb 01 2023 at 07:26):

ptitSeb commented on issue #5654:

Well, even with the workaround, I still think this function could be public, it seems more logical to use than the workaround.


Last updated: Dec 23 2024 at 13:07 UTC