Skip to content

Commit ff8ab19

Browse files
committed
C#: Drop caching for deprecated predicates.
1 parent 77807c8 commit ff8ab19

1 file changed

Lines changed: 37 additions & 43 deletions

File tree

  • csharp/ql/lib/semmle/code/csharp/dataflow/internal

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

Lines changed: 37 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -828,14 +828,6 @@ private module Cached {
828828
)
829829
}
830830

831-
cached
832-
deprecated AssignableDefinition getADefinition(Ssa::ExplicitDefinition def) {
833-
exists(Ssa::SourceVariable v, AssignableDefinition ad | explicitDefinition(def, v, ad) |
834-
result = ad or
835-
result = getASameOutRefDefAfter(v, ad)
836-
)
837-
}
838-
839831
/**
840832
* Holds if `call` may change the value of field or property `fp`. The actual
841833
* update occurs in `setter`.
@@ -861,36 +853,6 @@ private module Cached {
861853
not updatesNamedFieldOrProp(bb, i, _, v, _)
862854
}
863855

864-
cached
865-
deprecated predicate explicitDefinition(
866-
WriteDefinition def, Ssa::SourceVariable v, AssignableDefinition ad
867-
) {
868-
exists(BasicBlock bb, int i |
869-
def.definesAt(v, bb, i) and
870-
variableDefinition(bb, i, v, ad)
871-
)
872-
}
873-
874-
cached
875-
deprecated predicate isLiveAtEndOfBlock(Definition def, BasicBlock bb) {
876-
Impl::ssaDefReachesEndOfBlock(bb, def, _)
877-
}
878-
879-
cached
880-
deprecated Definition phiHasInputFromBlock(Ssa::PhiNode phi, BasicBlock bb) {
881-
Impl::phiHasInputFromBlock(phi, result, bb)
882-
}
883-
884-
cached
885-
deprecated AssignableRead getAReadAtNode(Definition def, ControlFlowNode cfn) {
886-
exists(Ssa::SourceVariable v, BasicBlock bb, int i |
887-
Impl::ssaDefReachesRead(v, def, bb, i) and
888-
variableReadActual(bb, i, v) and
889-
cfn = bb.getNode(i) and
890-
result.getControlFlowNode() = cfn
891-
)
892-
}
893-
894856
/**
895857
* Holds if the value defined at SSA definition `def` can reach a read at `cfn`,
896858
* without passing through any other read.
@@ -915,11 +877,6 @@ private module Cached {
915877
)
916878
}
917879

918-
cached
919-
deprecated Definition uncertainWriteDefinitionInput(UncertainWriteDefinition def) {
920-
Impl::uncertainWriteDefinitionInput(def, result)
921-
}
922-
923880
/**
924881
* Holds if the SSA definition `def` assigns to `out`/`ref` parameter `p`, and the
925882
* parameter may remain unchanged throughout the rest of the enclosing callable.
@@ -1009,6 +966,43 @@ private module Cached {
1009966

1010967
import Cached
1011968

969+
deprecated AssignableDefinition getADefinition(Ssa::ExplicitDefinition def) {
970+
exists(Ssa::SourceVariable v, AssignableDefinition ad | explicitDefinition(def, v, ad) |
971+
result = ad or
972+
result = getASameOutRefDefAfter(v, ad)
973+
)
974+
}
975+
976+
deprecated predicate explicitDefinition(
977+
WriteDefinition def, Ssa::SourceVariable v, AssignableDefinition ad
978+
) {
979+
exists(BasicBlock bb, int i |
980+
def.definesAt(v, bb, i) and
981+
variableDefinition(bb, i, v, ad)
982+
)
983+
}
984+
985+
deprecated predicate isLiveAtEndOfBlock(Definition def, BasicBlock bb) {
986+
Impl::ssaDefReachesEndOfBlock(bb, def, _)
987+
}
988+
989+
deprecated Definition phiHasInputFromBlock(Ssa::PhiNode phi, BasicBlock bb) {
990+
Impl::phiHasInputFromBlock(phi, result, bb)
991+
}
992+
993+
deprecated AssignableRead getAReadAtNode(Definition def, ControlFlowNode cfn) {
994+
exists(Ssa::SourceVariable v, BasicBlock bb, int i |
995+
Impl::ssaDefReachesRead(v, def, bb, i) and
996+
variableReadActual(bb, i, v) and
997+
cfn = bb.getNode(i) and
998+
result.getControlFlowNode() = cfn
999+
)
1000+
}
1001+
1002+
deprecated Definition uncertainWriteDefinitionInput(UncertainWriteDefinition def) {
1003+
Impl::uncertainWriteDefinitionInput(def, result)
1004+
}
1005+
10121006
private module DataFlowIntegrationInput implements Impl::DataFlowIntegrationInputSig {
10131007
private import codeql.util.Boolean
10141008

0 commit comments

Comments
 (0)