ControlFlow: Rename getAPhiInput to getAnInput.

This commit is contained in:
Anders Schack-Mulligen
2025-09-22 12:46:16 +02:00
parent 64caae554a
commit ca7d56023a
3 changed files with 9 additions and 3 deletions

View File

@@ -336,6 +336,9 @@ class SsaPhiNode extends SsaVariable instanceof PhiNode {
/** Gets an input to the phi node defining the SSA variable. */
SsaVariable getAPhiInput() { this.hasInputFromBlock(result, _) }
/** Gets an input to the phi node defining the SSA variable. */
SsaVariable getAnInput() { this.hasInputFromBlock(result, _) }
/** Holds if `inp` is an input to the phi node along the edge originating in `bb`. */
predicate hasInputFromBlock(SsaVariable inp, BasicBlock bb) {
phiHasInputFromBlock(this, inp, bb)

View File

@@ -366,6 +366,9 @@ class BaseSsaPhiNode extends BaseSsaVariable instanceof Impl::PhiNode {
/** Gets an input to the phi node defining the SSA variable. */
BaseSsaVariable getAPhiInput() { this.hasInputFromBlock(result, _) }
/** Gets an input to the phi node defining the SSA variable. */
BaseSsaVariable getAnInput() { 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)

View File

@@ -64,7 +64,7 @@ signature module InputSig<LocationSig Location, TypSig ControlFlowNode, TypSig B
/** Holds if `inp` is an input to the phi node along the edge originating in `bb`. */
predicate hasInputFromBlock(SsaDefinition inp, BasicBlock bb);
SsaDefinition getAPhiInput();
SsaDefinition getAnInput();
}
class SsaUncertainDefinition extends SsaDefinition {
@@ -663,8 +663,8 @@ module Make<
or
exists(SsaPhiNode phi |
phi.definesAt(var, loopEntry, _) and
phi.getAPhiInput+() = def and
def.(SsaPhiNode).getAPhiInput*() = phi
phi.getAnInput+() = def and
def.(SsaPhiNode).getAnInput*() = phi
)
)
}