Stream: cranelift

Topic: Dumping basic block contents


view this post on Zulip Piotr (Jan 04 2025 at 19:50):

Hi there, is there a way to dump the contents of a block to stdout? dbg!(block) only seems to print the id of the block.

view this post on Zulip bjorn3 (Jan 05 2025 at 15:01):

I don't think there is. There is dbg!(func) to print the entire function though.

view this post on Zulip bjorn3 (Jan 05 2025 at 15:02):

And you can manually iterate over the instrunctions in a block and print them individually.

view this post on Zulip Piotr (Jan 05 2025 at 17:55):

Will do, thank you for the information!

view this post on Zulip fitzgen (he/him) (Jan 14 2025 at 19:40):

fwiw, factoring out the print-one-block logic from the print-the-whole-function method into its own method would be cool to have, if you have the appetite for that kind of thing


Last updated: Jan 24 2025 at 00:11 UTC