[code-reflection] RFR: Remove the Op copy methods

Paul Sandoz psandoz at openjdk.org
Tue Sep 23 18:21:37 UTC 2025


The two `copy` methods on `Op` were not widely used, and may cause confusion as to which can be used and when to use the underlying `transform` method instead.

The no-arg `copy` method is very confusing because it only works for operations with no operands and capture no values, namely operations like `func` operations whose body is isolated. The single arg `copy` method defers to `transform` with the copying transformer, `OpTransformer.COPYING_TRANSFORMER`.

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

Commit messages:
 - Remove the Op copy methods.

Changes: https://git.openjdk.org/babylon/pull/581/files
  Webrev: https://webrevs.openjdk.org/?repo=babylon&pr=581&range=00
  Stats: 39 lines in 3 files changed: 7 ins; 27 del; 5 mod
  Patch: https://git.openjdk.org/babylon/pull/581.diff
  Fetch: git fetch https://git.openjdk.org/babylon.git pull/581/head:pull/581

PR: https://git.openjdk.org/babylon/pull/581


More information about the babylon-dev mailing list