mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
C++ IR: Remove Instruction.hasUse predicate
Now that it's been simplified to be the same as `getOperand`, it doesn't seem to have a purpose.
This commit is contained in:
@@ -269,8 +269,8 @@ class Instruction extends Construction::TInstruction {
|
||||
// Register results are always in SSA form.
|
||||
not hasMemoryResult() or
|
||||
// An unmodeled result will have a use on the `UnmodeledUse` instruction.
|
||||
not exists(UnmodeledUseOperand useTag |
|
||||
hasUse(_, useTag)
|
||||
not exists(Instruction useInstr, UnmodeledUseOperand useTag |
|
||||
this = useInstr.getOperand(useTag)
|
||||
)
|
||||
}
|
||||
|
||||
@@ -303,14 +303,6 @@ class Instruction extends Construction::TInstruction {
|
||||
final Instruction getAPredecessor() {
|
||||
result = getPredecessor(_)
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if the result of this instruction is consumed by `useInstruction` as
|
||||
* an operand with tag `useTag`.
|
||||
*/
|
||||
final predicate hasUse(Instruction useInstruction, OperandTag useTag) {
|
||||
this = useInstruction.getOperand(useTag)
|
||||
}
|
||||
}
|
||||
|
||||
class VariableInstruction extends Instruction {
|
||||
|
||||
@@ -160,7 +160,7 @@ predicate operandEscapes(Instruction instr, OperandTag tag) {
|
||||
predicate resultEscapes(Instruction instr) {
|
||||
// The result escapes if it has at least one use that escapes.
|
||||
exists(Instruction useInstr, OperandTag useOperandTag |
|
||||
instr.hasUse(useInstr, useOperandTag) and
|
||||
useInstr.getOperand(useOperandTag) = instr and
|
||||
operandEscapes(useInstr, useOperandTag)
|
||||
)
|
||||
}
|
||||
|
||||
@@ -269,8 +269,8 @@ class Instruction extends Construction::TInstruction {
|
||||
// Register results are always in SSA form.
|
||||
not hasMemoryResult() or
|
||||
// An unmodeled result will have a use on the `UnmodeledUse` instruction.
|
||||
not exists(UnmodeledUseOperand useTag |
|
||||
hasUse(_, useTag)
|
||||
not exists(Instruction useInstr, UnmodeledUseOperand useTag |
|
||||
this = useInstr.getOperand(useTag)
|
||||
)
|
||||
}
|
||||
|
||||
@@ -303,14 +303,6 @@ class Instruction extends Construction::TInstruction {
|
||||
final Instruction getAPredecessor() {
|
||||
result = getPredecessor(_)
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if the result of this instruction is consumed by `useInstruction` as
|
||||
* an operand with tag `useTag`.
|
||||
*/
|
||||
final predicate hasUse(Instruction useInstruction, OperandTag useTag) {
|
||||
this = useInstruction.getOperand(useTag)
|
||||
}
|
||||
}
|
||||
|
||||
class VariableInstruction extends Instruction {
|
||||
|
||||
@@ -160,7 +160,7 @@ predicate operandEscapes(Instruction instr, OperandTag tag) {
|
||||
predicate resultEscapes(Instruction instr) {
|
||||
// The result escapes if it has at least one use that escapes.
|
||||
exists(Instruction useInstr, OperandTag useOperandTag |
|
||||
instr.hasUse(useInstr, useOperandTag) and
|
||||
useInstr.getOperand(useOperandTag) = instr and
|
||||
operandEscapes(useInstr, useOperandTag)
|
||||
)
|
||||
}
|
||||
|
||||
@@ -269,8 +269,8 @@ class Instruction extends Construction::TInstruction {
|
||||
// Register results are always in SSA form.
|
||||
not hasMemoryResult() or
|
||||
// An unmodeled result will have a use on the `UnmodeledUse` instruction.
|
||||
not exists(UnmodeledUseOperand useTag |
|
||||
hasUse(_, useTag)
|
||||
not exists(Instruction useInstr, UnmodeledUseOperand useTag |
|
||||
this = useInstr.getOperand(useTag)
|
||||
)
|
||||
}
|
||||
|
||||
@@ -303,14 +303,6 @@ class Instruction extends Construction::TInstruction {
|
||||
final Instruction getAPredecessor() {
|
||||
result = getPredecessor(_)
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if the result of this instruction is consumed by `useInstruction` as
|
||||
* an operand with tag `useTag`.
|
||||
*/
|
||||
final predicate hasUse(Instruction useInstruction, OperandTag useTag) {
|
||||
this = useInstruction.getOperand(useTag)
|
||||
}
|
||||
}
|
||||
|
||||
class VariableInstruction extends Instruction {
|
||||
|
||||
Reference in New Issue
Block a user