Skip to content

Commit 9a419d4

Browse files
committed
CPP: deprecate some unused but publicly visible predicates
1 parent 5b3ef70 commit 9a419d4

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

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

+5-5
Original file line numberDiff line numberDiff line change
@@ -715,7 +715,7 @@ ExprNode exprNode(Expr e) { result.getExpr() = e }
715715
* argument is passed by reference, use
716716
* `definitionByReferenceNodeFromArgument` instead.
717717
*/
718-
ExprNode convertedExprNode(Expr e) { result.getConvertedExpr() = e }
718+
deprecated ExprNode convertedExprNode(Expr e) { result.getConvertedExpr() = e }
719719

720720
/**
721721
* Gets the `Node` corresponding to the value of `p` at function entry.
@@ -731,15 +731,15 @@ DefinitionByReferenceNode definitionByReferenceNodeFromArgument(Expr argument) {
731731
}
732732

733733
/** Gets the `VariableNode` corresponding to the variable `v`. */
734-
VariableNode variableNode(Variable v) { result.getVariable() = v }
734+
deprecated VariableNode variableNode(Variable v) { result.getVariable() = v }
735735

736736
/**
737737
* DEPRECATED: See UninitializedNode.
738738
*
739739
* Gets the `Node` corresponding to the value of an uninitialized local
740740
* variable `v`.
741741
*/
742-
Node uninitializedNode(LocalVariable v) { none() }
742+
deprecated Node uninitializedNode(LocalVariable v) { none() }
743743

744744
/**
745745
* Holds if data flows from `nodeFrom` to `nodeTo` in exactly one local
@@ -1008,7 +1008,7 @@ predicate localFlow(Node source, Node sink) { localFlowStep*(source, sink) }
10081008
* local (intra-procedural) steps.
10091009
*/
10101010
pragma[inline]
1011-
predicate localInstructionFlow(Instruction e1, Instruction e2) {
1011+
deprecated predicate localInstructionFlow(Instruction e1, Instruction e2) {
10121012
localFlow(instructionNode(e1), instructionNode(e2))
10131013
}
10141014

@@ -1017,7 +1017,7 @@ predicate localInstructionFlow(Instruction e1, Instruction e2) {
10171017
* local (intra-procedural) steps.
10181018
*/
10191019
pragma[inline]
1020-
predicate localExprFlow(Expr e1, Expr e2) { localFlow(exprNode(e1), exprNode(e2)) }
1020+
deprecated predicate localExprFlow(Expr e1, Expr e2) { localFlow(exprNode(e1), exprNode(e2)) }
10211021

10221022
private newtype TContent =
10231023
TFieldContent(Field f) {

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

+3-1
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,9 @@ Instruction getSourceAddressFromNode(Node node) {
267267
}
268268

269269
/** Gets the source value of `instr` if it's an instruction that behaves like a `LoadInstruction`. */
270-
Instruction getSourceValue(Instruction instr) { result = getSourceValueOperand(instr).getDef() }
270+
deprecated Instruction getSourceValue(Instruction instr) {
271+
result = getSourceValueOperand(instr).getDef()
272+
}
271273

272274
/**
273275
* Gets the operand that represents the source value of `instr` if it's an instruction

0 commit comments

Comments
 (0)