mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
C++: Add a 'hasInputFromBlock' predicate.
This commit is contained in:
@@ -1126,7 +1126,15 @@ predicate ssaFlow(Node nodeFrom, Node nodeTo) {
|
|||||||
*/
|
*/
|
||||||
class PhiNode extends Definition instanceof SsaImpl::PhiNode {
|
class PhiNode extends Definition instanceof SsaImpl::PhiNode {
|
||||||
/** Gets a definition that is an input to this phi node. */
|
/** 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. */
|
/** An static single assignment (SSA) definition. */
|
||||||
|
|||||||
Reference in New Issue
Block a user