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 anIf
exist or not.Implementation
Make the current function public
Alternatives
I don't see any practical alternative
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?
ptitSeb commented on issue #5654:
Probably, I'll check that. Thanks.
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.
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 anIf
exist or not.Implementation
Make the current function public
Alternatives
I don't see any practical alternative
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