C++: Add a 'hasInputFromBlock' predicate.

This commit is contained in:
Mathias Vorreiter Pedersen
2025-09-17 16:06:22 +01:00
parent f55ace8311
commit f47dd2bbc6

View File

@@ -1126,7 +1126,15 @@ predicate ssaFlow(Node nodeFrom, Node nodeTo) {
*/
class PhiNode extends Definition instanceof SsaImpl::PhiNode {
/** Gets a definition that is an input to this phi node. */
final Definition getAnInput() { phiHasInputFromBlock(this, result, _) }
final Definition getAnInput() { this.hasInputFromBlock(result, _) }
/**
* Holds if `input` is an input to this phi node along the edge originating
* in `bb`.
*/
final predicate hasInputFromBlock(Definition input, IRBlock bb) {
phiHasInputFromBlock(this, input, bb)
}
}
/** An static single assignment (SSA) definition. */