mirror of
https://github.com/github/codeql.git
synced 2025-12-23 12:16:33 +01:00
Merge pull request #8542 from MathiasVP/public-iterated-dominance-frontier
C++: Use `iterated (post)dominance frontier` algorithm in `IRBlock`
This commit is contained in:
@@ -161,8 +161,13 @@ class IRBlock extends IRBlockBase {
|
|||||||
*/
|
*/
|
||||||
pragma[noinline]
|
pragma[noinline]
|
||||||
final IRBlock dominanceFrontier() {
|
final IRBlock dominanceFrontier() {
|
||||||
this.dominates(result.getAPredecessor()) and
|
this.getASuccessor() = result and
|
||||||
not this.strictlyDominates(result)
|
not this.immediatelyDominates(result)
|
||||||
|
or
|
||||||
|
exists(IRBlock prev | result = prev.dominanceFrontier() |
|
||||||
|
this.immediatelyDominates(prev) and
|
||||||
|
not this.immediatelyDominates(result)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -201,8 +206,13 @@ class IRBlock extends IRBlockBase {
|
|||||||
*/
|
*/
|
||||||
pragma[noinline]
|
pragma[noinline]
|
||||||
final IRBlock postDominanceFrontier() {
|
final IRBlock postDominanceFrontier() {
|
||||||
this.postDominates(result.getASuccessor()) and
|
this.getAPredecessor() = result and
|
||||||
not this.strictlyPostDominates(result)
|
not this.immediatelyPostDominates(result)
|
||||||
|
or
|
||||||
|
exists(IRBlock prev | result = prev.postDominanceFrontier() |
|
||||||
|
this.immediatelyPostDominates(prev) and
|
||||||
|
not this.immediatelyPostDominates(result)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -161,8 +161,13 @@ class IRBlock extends IRBlockBase {
|
|||||||
*/
|
*/
|
||||||
pragma[noinline]
|
pragma[noinline]
|
||||||
final IRBlock dominanceFrontier() {
|
final IRBlock dominanceFrontier() {
|
||||||
this.dominates(result.getAPredecessor()) and
|
this.getASuccessor() = result and
|
||||||
not this.strictlyDominates(result)
|
not this.immediatelyDominates(result)
|
||||||
|
or
|
||||||
|
exists(IRBlock prev | result = prev.dominanceFrontier() |
|
||||||
|
this.immediatelyDominates(prev) and
|
||||||
|
not this.immediatelyDominates(result)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -201,8 +206,13 @@ class IRBlock extends IRBlockBase {
|
|||||||
*/
|
*/
|
||||||
pragma[noinline]
|
pragma[noinline]
|
||||||
final IRBlock postDominanceFrontier() {
|
final IRBlock postDominanceFrontier() {
|
||||||
this.postDominates(result.getASuccessor()) and
|
this.getAPredecessor() = result and
|
||||||
not this.strictlyPostDominates(result)
|
not this.immediatelyPostDominates(result)
|
||||||
|
or
|
||||||
|
exists(IRBlock prev | result = prev.postDominanceFrontier() |
|
||||||
|
this.immediatelyPostDominates(prev) and
|
||||||
|
not this.immediatelyPostDominates(result)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -161,8 +161,13 @@ class IRBlock extends IRBlockBase {
|
|||||||
*/
|
*/
|
||||||
pragma[noinline]
|
pragma[noinline]
|
||||||
final IRBlock dominanceFrontier() {
|
final IRBlock dominanceFrontier() {
|
||||||
this.dominates(result.getAPredecessor()) and
|
this.getASuccessor() = result and
|
||||||
not this.strictlyDominates(result)
|
not this.immediatelyDominates(result)
|
||||||
|
or
|
||||||
|
exists(IRBlock prev | result = prev.dominanceFrontier() |
|
||||||
|
this.immediatelyDominates(prev) and
|
||||||
|
not this.immediatelyDominates(result)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -201,8 +206,13 @@ class IRBlock extends IRBlockBase {
|
|||||||
*/
|
*/
|
||||||
pragma[noinline]
|
pragma[noinline]
|
||||||
final IRBlock postDominanceFrontier() {
|
final IRBlock postDominanceFrontier() {
|
||||||
this.postDominates(result.getASuccessor()) and
|
this.getAPredecessor() = result and
|
||||||
not this.strictlyPostDominates(result)
|
not this.immediatelyPostDominates(result)
|
||||||
|
or
|
||||||
|
exists(IRBlock prev | result = prev.postDominanceFrontier() |
|
||||||
|
this.immediatelyPostDominates(prev) and
|
||||||
|
not this.immediatelyPostDominates(result)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -161,8 +161,13 @@ class IRBlock extends IRBlockBase {
|
|||||||
*/
|
*/
|
||||||
pragma[noinline]
|
pragma[noinline]
|
||||||
final IRBlock dominanceFrontier() {
|
final IRBlock dominanceFrontier() {
|
||||||
this.dominates(result.getAPredecessor()) and
|
this.getASuccessor() = result and
|
||||||
not this.strictlyDominates(result)
|
not this.immediatelyDominates(result)
|
||||||
|
or
|
||||||
|
exists(IRBlock prev | result = prev.dominanceFrontier() |
|
||||||
|
this.immediatelyDominates(prev) and
|
||||||
|
not this.immediatelyDominates(result)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -201,8 +206,13 @@ class IRBlock extends IRBlockBase {
|
|||||||
*/
|
*/
|
||||||
pragma[noinline]
|
pragma[noinline]
|
||||||
final IRBlock postDominanceFrontier() {
|
final IRBlock postDominanceFrontier() {
|
||||||
this.postDominates(result.getASuccessor()) and
|
this.getAPredecessor() = result and
|
||||||
not this.strictlyPostDominates(result)
|
not this.immediatelyPostDominates(result)
|
||||||
|
or
|
||||||
|
exists(IRBlock prev | result = prev.postDominanceFrontier() |
|
||||||
|
this.immediatelyPostDominates(prev) and
|
||||||
|
not this.immediatelyPostDominates(result)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -161,8 +161,13 @@ class IRBlock extends IRBlockBase {
|
|||||||
*/
|
*/
|
||||||
pragma[noinline]
|
pragma[noinline]
|
||||||
final IRBlock dominanceFrontier() {
|
final IRBlock dominanceFrontier() {
|
||||||
this.dominates(result.getAPredecessor()) and
|
this.getASuccessor() = result and
|
||||||
not this.strictlyDominates(result)
|
not this.immediatelyDominates(result)
|
||||||
|
or
|
||||||
|
exists(IRBlock prev | result = prev.dominanceFrontier() |
|
||||||
|
this.immediatelyDominates(prev) and
|
||||||
|
not this.immediatelyDominates(result)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -201,8 +206,13 @@ class IRBlock extends IRBlockBase {
|
|||||||
*/
|
*/
|
||||||
pragma[noinline]
|
pragma[noinline]
|
||||||
final IRBlock postDominanceFrontier() {
|
final IRBlock postDominanceFrontier() {
|
||||||
this.postDominates(result.getASuccessor()) and
|
this.getAPredecessor() = result and
|
||||||
not this.strictlyPostDominates(result)
|
not this.immediatelyPostDominates(result)
|
||||||
|
or
|
||||||
|
exists(IRBlock prev | result = prev.postDominanceFrontier() |
|
||||||
|
this.immediatelyPostDominates(prev) and
|
||||||
|
not this.immediatelyPostDominates(result)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user