mirror of
https://github.com/github/codeql.git
synced 2026-04-27 09:45:15 +02:00
C++: Improve join order in IR reachability
This commit is contained in:
@@ -22,7 +22,9 @@ IRBlock getAFeasiblePredecessor(IRBlock successor) {
|
||||
}
|
||||
|
||||
predicate isBlockReachable(IRBlock block) {
|
||||
getAFeasiblePredecessor*(block) = block.getFunctionIR().getEntryBlock()
|
||||
exists(FunctionIR f |
|
||||
getAFeasiblePredecessor*(block) = f.getEntryBlock()
|
||||
)
|
||||
}
|
||||
|
||||
predicate isInstructionReachable(Instruction instr) {
|
||||
@@ -43,7 +45,9 @@ class ReachableInstruction extends Instruction {
|
||||
|
||||
module Graph {
|
||||
predicate isEntryBlock(ReachableBlock block) {
|
||||
block = block.getFunctionIR().getEntryBlock()
|
||||
exists(FunctionIR f |
|
||||
block = f.getEntryBlock()
|
||||
)
|
||||
}
|
||||
|
||||
predicate blockSuccessor(ReachableBlock pred, ReachableBlock succ) {
|
||||
|
||||
@@ -22,7 +22,9 @@ IRBlock getAFeasiblePredecessor(IRBlock successor) {
|
||||
}
|
||||
|
||||
predicate isBlockReachable(IRBlock block) {
|
||||
getAFeasiblePredecessor*(block) = block.getFunctionIR().getEntryBlock()
|
||||
exists(FunctionIR f |
|
||||
getAFeasiblePredecessor*(block) = f.getEntryBlock()
|
||||
)
|
||||
}
|
||||
|
||||
predicate isInstructionReachable(Instruction instr) {
|
||||
@@ -43,7 +45,9 @@ class ReachableInstruction extends Instruction {
|
||||
|
||||
module Graph {
|
||||
predicate isEntryBlock(ReachableBlock block) {
|
||||
block = block.getFunctionIR().getEntryBlock()
|
||||
exists(FunctionIR f |
|
||||
block = f.getEntryBlock()
|
||||
)
|
||||
}
|
||||
|
||||
predicate blockSuccessor(ReachableBlock pred, ReachableBlock succ) {
|
||||
|
||||
@@ -22,7 +22,9 @@ IRBlock getAFeasiblePredecessor(IRBlock successor) {
|
||||
}
|
||||
|
||||
predicate isBlockReachable(IRBlock block) {
|
||||
getAFeasiblePredecessor*(block) = block.getFunctionIR().getEntryBlock()
|
||||
exists(FunctionIR f |
|
||||
getAFeasiblePredecessor*(block) = f.getEntryBlock()
|
||||
)
|
||||
}
|
||||
|
||||
predicate isInstructionReachable(Instruction instr) {
|
||||
@@ -43,7 +45,9 @@ class ReachableInstruction extends Instruction {
|
||||
|
||||
module Graph {
|
||||
predicate isEntryBlock(ReachableBlock block) {
|
||||
block = block.getFunctionIR().getEntryBlock()
|
||||
exists(FunctionIR f |
|
||||
block = f.getEntryBlock()
|
||||
)
|
||||
}
|
||||
|
||||
predicate blockSuccessor(ReachableBlock pred, ReachableBlock succ) {
|
||||
|
||||
Reference in New Issue
Block a user