[code-reflection] RFR: Disallow insertion of a root op in a block

Paul Sandoz psandoz at openjdk.org
Tue May 13 19:26:17 UTC 2025


On Mon, 12 May 2025 21:42:35 GMT, Mourad Abbay <mabbay at openjdk.org> wrote:

> A root operation shouldn't be inserted in a block. This changes enforce this rule.

That was a reasonable attempt, but it will not work because a func op can be a descendant of a module op (there might be one or two tests that fail). Nor will it generalize for operations of other dialects.

We need a general solution that can be applied to any operation. By default we would apply the solution to func ops extracted from classfiles. I think we need to assign a special value to `Op.result` that indicates it is bound as a root but `Op.parentBlock()` still returns `null`.

-------------

PR Review: https://git.openjdk.org/babylon/pull/425#pullrequestreview-2837884766


More information about the babylon-dev mailing list