Skip to content

Commit 0c79c28

Browse files
authored
Merge pull request #10573 from erik-krogh/cpp-unqueryable
C: deprecate/delete some unused code
2 parents 9f1bbf2 + 0f1a8a6 commit 0c79c28

File tree

8 files changed

+1
-58
lines changed

8 files changed

+1
-58
lines changed

cpp/ql/lib/semmle/code/cpp/commons/Strcat.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import cpp
66
* A function that concatenates the string from its second argument
77
* to the string from its first argument, for example `strcat`.
88
*/
9-
class StrcatFunction extends Function {
9+
deprecated class StrcatFunction extends Function {
1010
StrcatFunction() {
1111
getName() =
1212
[

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,9 +267,6 @@ Instruction getSourceAddressFromNode(Node node) {
267267
result = getSourceAddress(node.asOperand().(SideEffectOperand).getUse())
268268
}
269269

270-
/** Gets the source value of `instr` if it's an instruction that behaves like a `LoadInstruction`. */
271-
Instruction getSourceValue(Instruction instr) { result = getSourceValueOperand(instr).getDef() }
272-
273270
/**
274271
* Gets the operand that represents the source value of `instr` if it's an instruction
275272
* that behaves like a `LoadInstruction`.

cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/internal/SSAConstruction.qll

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -143,16 +143,6 @@ private module Cached {
143143
)
144144
}
145145

146-
cached
147-
Instruction getRegisterOperandDefinition(Instruction instruction, RegisterOperandTag tag) {
148-
exists(OldInstruction oldInstruction, OldIR::RegisterOperand oldOperand |
149-
oldInstruction = getOldInstruction(instruction) and
150-
oldOperand = oldInstruction.getAnOperand() and
151-
tag = oldOperand.getOperandTag() and
152-
result = getNewInstruction(oldOperand.getAnyDef())
153-
)
154-
}
155-
156146
pragma[noopt]
157147
private predicate hasMemoryOperandDefinition(
158148
OldInstruction oldInstruction, OldIR::NonPhiMemoryOperand oldOperand, Overlap overlap,

cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/IRConstruction.qll

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -256,12 +256,6 @@ CppType getInstructionOperandType(Instruction instruction, TypedOperandTag tag)
256256
.getInstructionMemoryOperandType(getInstructionTag(instruction), tag)
257257
}
258258

259-
Instruction getPhiOperandDefinition(
260-
PhiInstruction instruction, IRBlock predecessorBlock, Overlap overlap
261-
) {
262-
none()
263-
}
264-
265259
Instruction getPhiInstructionBlockStart(PhiInstruction instr) { none() }
266260

267261
Instruction getInstructionSuccessor(Instruction instruction, EdgeKind kind) {

cpp/ql/lib/semmle/code/cpp/ir/implementation/unaliased_ssa/internal/SSAConstruction.qll

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -143,16 +143,6 @@ private module Cached {
143143
)
144144
}
145145

146-
cached
147-
Instruction getRegisterOperandDefinition(Instruction instruction, RegisterOperandTag tag) {
148-
exists(OldInstruction oldInstruction, OldIR::RegisterOperand oldOperand |
149-
oldInstruction = getOldInstruction(instruction) and
150-
oldOperand = oldInstruction.getAnOperand() and
151-
tag = oldOperand.getOperandTag() and
152-
result = getNewInstruction(oldOperand.getAnyDef())
153-
)
154-
}
155-
156146
pragma[noopt]
157147
private predicate hasMemoryOperandDefinition(
158148
OldInstruction oldInstruction, OldIR::NonPhiMemoryOperand oldOperand, Overlap overlap,

cpp/ql/src/Best Practices/Magic Constants/MagicConstants.qll

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -72,18 +72,6 @@ predicate floatTrivial(Literal lit) {
7272

7373
predicate charLiteral(Literal lit) { lit instanceof CharLiteral }
7474

75-
Type literalType(Literal literal) { result = literal.getType() }
76-
77-
predicate stringType(DerivedType t) {
78-
t.getBaseType() instanceof CharType
79-
or
80-
exists(SpecifiedType constCharType |
81-
t.getBaseType() = constCharType and
82-
constCharType.isConst() and
83-
constCharType.getBaseType() instanceof CharType
84-
)
85-
}
86-
8775
predicate numberType(Type t) { t instanceof FloatingPointType or t instanceof IntegralType }
8876

8977
predicate stringLiteral(Literal literal) { literal instanceof StringLiteral }

cpp/ql/src/Security/CWE/CWE-457/UninitializedVariables.qll

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,6 @@ private predicate reaches(ControlFlowNode a, ControlFlowNode b) = fastTC(success
1010

1111
private predicate successor(ControlFlowNode a, ControlFlowNode b) { b = a.getASuccessor() }
1212

13-
class WhitelistedCallsConfig extends string {
14-
WhitelistedCallsConfig() { this = "config" }
15-
16-
abstract predicate isWhitelisted(Call c);
17-
}
18-
1913
abstract class WhitelistedCall extends Call {
2014
override Function getTarget() { none() }
2115
}

csharp/ql/src/experimental/ir/implementation/unaliased_ssa/internal/SSAConstruction.qll

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -143,16 +143,6 @@ private module Cached {
143143
)
144144
}
145145

146-
cached
147-
Instruction getRegisterOperandDefinition(Instruction instruction, RegisterOperandTag tag) {
148-
exists(OldInstruction oldInstruction, OldIR::RegisterOperand oldOperand |
149-
oldInstruction = getOldInstruction(instruction) and
150-
oldOperand = oldInstruction.getAnOperand() and
151-
tag = oldOperand.getOperandTag() and
152-
result = getNewInstruction(oldOperand.getAnyDef())
153-
)
154-
}
155-
156146
pragma[noopt]
157147
private predicate hasMemoryOperandDefinition(
158148
OldInstruction oldInstruction, OldIR::NonPhiMemoryOperand oldOperand, Overlap overlap,

0 commit comments

Comments
 (0)