Java: Add hasInputFromBlock predicate in BaseSSA.

This commit is contained in:
Anders Schack-Mulligen
2025-05-02 12:42:21 +02:00
parent a0c849139c
commit 994c1f6427

View File

@@ -372,5 +372,10 @@ class BaseSsaImplicitInit extends BaseSsaVariable instanceof Impl::WriteDefiniti
/** An SSA phi node. */
class BaseSsaPhiNode extends BaseSsaVariable instanceof Impl::PhiNode {
/** Gets an input to the phi node defining the SSA variable. */
BaseSsaVariable getAPhiInput() { phiHasInputFromBlock(this, result, _) }
BaseSsaVariable getAPhiInput() { this.hasInputFromBlock(result, _) }
/** Holds if `inp` is an input to the phi node along the edge originating in `bb`. */
predicate hasInputFromBlock(BaseSsaVariable inp, BasicBlock bb) {
phiHasInputFromBlock(this, inp, bb)
}
}