Skip to content

Commit b45f56a

Browse files
authored
Merge pull request #8431 from erik-krogh/deadCode
Delete dead code
2 parents 57922f5 + c7509c4 commit b45f56a

File tree

37 files changed

+326
-304
lines changed

37 files changed

+326
-304
lines changed

cpp/ql/lib/semmle/code/cpp/controlflow/internal/CFG.qll

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -447,26 +447,6 @@ private predicate skipInitializer(Initializer init) {
447447
)
448448
}
449449

450-
/**
451-
* Holds if `e` is an expression in a static initializer that must be evaluated
452-
* at run time. This predicate computes "is non-const" instead of "is const" in
453-
* order to avoid recursion through forall.
454-
*/
455-
private predicate runtimeExprInStaticInitializer(Expr e) {
456-
inStaticInitializer(e) and
457-
if e instanceof AggregateLiteral
458-
then runtimeExprInStaticInitializer(e.getAChild())
459-
else not e.getFullyConverted().isConstant()
460-
}
461-
462-
/** Holds if `e` is part of the initializer of a local static variable. */
463-
private predicate inStaticInitializer(Expr e) {
464-
exists(LocalVariable local |
465-
local.isStatic() and
466-
e.getParent+() = local.getInitializer()
467-
)
468-
}
469-
470450
/**
471451
* Gets the `i`th child of `n` in control-flow order, where the `i`-indexes are
472452
* contiguous, and the first index is 0.

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

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -287,20 +287,6 @@ private module SsaDefReaches {
287287
)
288288
}
289289

290-
/**
291-
* Holds if the SSA definition of `v` at `def` reaches uncertain SSA definition
292-
* `redef` in the same basic block, without crossing another SSA definition of `v`.
293-
*/
294-
predicate ssaDefReachesUncertainDefWithinBlock(
295-
SourceVariable v, Definition def, UncertainWriteDefinition redef
296-
) {
297-
exists(BasicBlock bb, int rnk, int i |
298-
ssaDefReachesRank(bb, def, rnk, v) and
299-
rnk = ssaRefRank(bb, i, v, SsaDef()) - 1 and
300-
redef.definesAt(v, bb, i)
301-
)
302-
}
303-
304290
/**
305291
* Same as `ssaRefRank()`, but restricted to a particular SSA definition `def`.
306292
*/

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
private import ReachableBlock as Reachability
22

3-
private module ReachabilityGraph = Reachability::Graph;
4-
53
module Graph {
64
import Reachability::Graph
75

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
private import ReachableBlock as Reachability
22

3-
private module ReachabilityGraph = Reachability::Graph;
4-
53
module Graph {
64
import Reachability::Graph
75

csharp/ql/lib/semmle/code/cil/internal/SsaImplCommon.qll

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -287,20 +287,6 @@ private module SsaDefReaches {
287287
)
288288
}
289289

290-
/**
291-
* Holds if the SSA definition of `v` at `def` reaches uncertain SSA definition
292-
* `redef` in the same basic block, without crossing another SSA definition of `v`.
293-
*/
294-
predicate ssaDefReachesUncertainDefWithinBlock(
295-
SourceVariable v, Definition def, UncertainWriteDefinition redef
296-
) {
297-
exists(BasicBlock bb, int rnk, int i |
298-
ssaDefReachesRank(bb, def, rnk, v) and
299-
rnk = ssaRefRank(bb, i, v, SsaDef()) - 1 and
300-
redef.definesAt(v, bb, i)
301-
)
302-
}
303-
304290
/**
305291
* Same as `ssaRefRank()`, but restricted to a particular SSA definition `def`.
306292
*/

csharp/ql/lib/semmle/code/csharp/controlflow/internal/Splitting.qll

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -511,13 +511,6 @@ module FinallySplitting {
511511
predicate isEntryNode() { first(try.getFinally(), this) }
512512
}
513513

514-
/** A control flow element that does not belong to a `finally` block. */
515-
private class NonFinallyControlFlowElement extends ControlFlowElement {
516-
NonFinallyControlFlowElement() {
517-
not this = any(Statements::TryStmtTree t).getAFinallyDescendant()
518-
}
519-
}
520-
521514
/**
522515
* A split for elements belonging to a `finally` block, which determines how to
523516
* continue execution after leaving the `finally` block. For example, in

csharp/ql/lib/semmle/code/csharp/controlflow/internal/pressa/SsaImplCommon.qll

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -287,20 +287,6 @@ private module SsaDefReaches {
287287
)
288288
}
289289

290-
/**
291-
* Holds if the SSA definition of `v` at `def` reaches uncertain SSA definition
292-
* `redef` in the same basic block, without crossing another SSA definition of `v`.
293-
*/
294-
predicate ssaDefReachesUncertainDefWithinBlock(
295-
SourceVariable v, Definition def, UncertainWriteDefinition redef
296-
) {
297-
exists(BasicBlock bb, int rnk, int i |
298-
ssaDefReachesRank(bb, def, rnk, v) and
299-
rnk = ssaRefRank(bb, i, v, SsaDef()) - 1 and
300-
redef.definesAt(v, bb, i)
301-
)
302-
}
303-
304290
/**
305291
* Same as `ssaRefRank()`, but restricted to a particular SSA definition `def`.
306292
*/

csharp/ql/lib/semmle/code/csharp/dataflow/internal/SsaImplCommon.qll

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -287,20 +287,6 @@ private module SsaDefReaches {
287287
)
288288
}
289289

290-
/**
291-
* Holds if the SSA definition of `v` at `def` reaches uncertain SSA definition
292-
* `redef` in the same basic block, without crossing another SSA definition of `v`.
293-
*/
294-
predicate ssaDefReachesUncertainDefWithinBlock(
295-
SourceVariable v, Definition def, UncertainWriteDefinition redef
296-
) {
297-
exists(BasicBlock bb, int rnk, int i |
298-
ssaDefReachesRank(bb, def, rnk, v) and
299-
rnk = ssaRefRank(bb, i, v, SsaDef()) - 1 and
300-
redef.definesAt(v, bb, i)
301-
)
302-
}
303-
304290
/**
305291
* Same as `ssaRefRank()`, but restricted to a particular SSA definition `def`.
306292
*/

csharp/ql/lib/semmle/code/csharp/dataflow/internal/basessa/SsaImplCommon.qll

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -287,20 +287,6 @@ private module SsaDefReaches {
287287
)
288288
}
289289

290-
/**
291-
* Holds if the SSA definition of `v` at `def` reaches uncertain SSA definition
292-
* `redef` in the same basic block, without crossing another SSA definition of `v`.
293-
*/
294-
predicate ssaDefReachesUncertainDefWithinBlock(
295-
SourceVariable v, Definition def, UncertainWriteDefinition redef
296-
) {
297-
exists(BasicBlock bb, int rnk, int i |
298-
ssaDefReachesRank(bb, def, rnk, v) and
299-
rnk = ssaRefRank(bb, i, v, SsaDef()) - 1 and
300-
redef.definesAt(v, bb, i)
301-
)
302-
}
303-
304290
/**
305291
* Same as `ssaRefRank()`, but restricted to a particular SSA definition `def`.
306292
*/

csharp/ql/lib/semmle/code/csharp/frameworks/ServiceStack.qll

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,6 @@ private class ServiceClass extends Class {
2424
}
2525
}
2626

27-
/** Top-level Request DTO types */
28-
private class RequestDTO extends Class {
29-
RequestDTO() {
30-
this.getABaseType*().getABaseInterface().hasQualifiedName("ServiceStack", "IReturn")
31-
}
32-
}
33-
3427
/** Flow sources for the ServiceStack framework */
3528
module Sources {
3629
private import semmle.code.csharp.security.dataflow.flowsources.Remote

0 commit comments

Comments
 (0)