Skip to content

Commit 4ee13a3

Browse files
committed
C++: Remove getLocationImpl predicate that is always overridden
Also remove the predicate referred to in ints implementation, as it is no longer used.
1 parent 791f591 commit 4ee13a3

File tree

2 files changed

+0
-14
lines changed

2 files changed

+0
-14
lines changed

cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowPrivate.qll

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -56,19 +56,11 @@ class Node0Impl extends TIRDataFlowNode0 {
5656
/** Gets the operands corresponding to this node, if any. */
5757
Operand asOperand() { result = this.(OperandNode0).getOperand() }
5858

59-
/** INTERNAL: Do not use. */
60-
Location getLocationImpl() {
61-
none() // overridden by subclasses
62-
}
63-
6459
/** INTERNAL: Do not use. */
6560
string toStringImpl() {
6661
none() // overridden by subclasses
6762
}
6863

69-
/** Gets the location of this node. */
70-
final Location getLocation() { result = this.getLocationImpl() }
71-
7264
/** Gets a textual representation of this node. */
7365
final string toString() { result = this.toStringImpl() }
7466

@@ -113,8 +105,6 @@ abstract class InstructionNode0 extends Node0Impl {
113105

114106
override DataFlowType getType() { result = getInstructionType(instr, _) }
115107

116-
final override Location getLocationImpl() { result = instr.getLocation() }
117-
118108
override string toStringImpl() {
119109
// This predicate is overridden in subclasses. This default implementation
120110
// does not use `Instruction.toString` because that's expensive to compute.
@@ -158,8 +148,6 @@ abstract class OperandNode0 extends Node0Impl {
158148

159149
override DataFlowType getType() { result = getOperandType(op, _) }
160150

161-
final override Location getLocationImpl() { result = op.getLocation() }
162-
163151
override string toStringImpl() { result = op.toString() }
164152

165153
final override predicate isGLValue() { exists(getOperandType(op, true)) }

cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowUtil.qll

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,8 +390,6 @@ private class Node0 extends Node, TNode0 {
390390

391391
override DataFlowType getType() { result = node.getType() }
392392

393-
override Location getLocationImpl() { result = node.getLocationImpl() }
394-
395393
override string toStringImpl() {
396394
// This predicate is overridden in subclasses. This default implementation
397395
// does not use `Instruction.toString` because that's expensive to compute.

0 commit comments

Comments
 (0)