Skip to content

Commit

Permalink
Query: Use index stack dfg in the DFG query (#1972)
Browse files Browse the repository at this point in the history
* Query: Use index stack dfg in the DFG query

* Configure stack usage
  • Loading branch information
KuechA authored Jan 24, 2025
1 parent e4845ec commit 81b9939
Showing 1 changed file with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,16 @@ fun dataFlow(
to: Node,
collectFailedPaths: Boolean = true,
findAllPossiblePaths: Boolean = true,
useIndexStack: Boolean = true,
): QueryTree<Boolean> {
val evalRes =
from.followNextFullDFGEdgesUntilHit(collectFailedPaths, findAllPossiblePaths) { it == to }
from.followNextDFGEdgesUntilHit(
collectFailedPaths = collectFailedPaths,
findAllPossiblePaths = findAllPossiblePaths,
useIndexStack = useIndexStack,
) {
it == to
}
val allPaths = evalRes.fulfilled.map { QueryTree(it) }.toMutableList()
if (collectFailedPaths) allPaths.addAll(evalRes.failed.map { QueryTree(it) })
return QueryTree(
Expand All @@ -227,9 +234,15 @@ fun dataFlow(
predicate: (Node) -> Boolean,
collectFailedPaths: Boolean = true,
findAllPossiblePaths: Boolean = true,
useIndexStack: Boolean = true,
): QueryTree<Boolean> {
val evalRes =
from.followNextFullDFGEdgesUntilHit(collectFailedPaths, findAllPossiblePaths, predicate)
from.followNextDFGEdgesUntilHit(
collectFailedPaths = collectFailedPaths,
findAllPossiblePaths = findAllPossiblePaths,
useIndexStack = useIndexStack,
predicate = predicate,
)
val allPaths = evalRes.fulfilled.map { QueryTree(it) }.toMutableList()
if (collectFailedPaths) allPaths.addAll(evalRes.failed.map { QueryTree(it) })
return QueryTree(
Expand Down

0 comments on commit 81b9939

Please sign in to comment.