Skip to content

Commit

Permalink
Fix recursive tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
leventeBajczi committed Nov 11, 2024
1 parent b6fa215 commit b772fc9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ fun <K, V> Map<K, V>.reverseMapping() = this.entries.associate { it.value to it.
fun Valuation.changeVars(varLut: Map<out Decl<*>, VarDecl<*>>): Valuation {
val builder = ImmutableValuation.builder()
for (decl in this.decls) {
builder.put(decl.changeVars(varLut), this.eval(decl).get())
if (decl in varLut) {
builder.put(decl.changeVars(varLut), this.eval(decl).get())
}
}
return builder.build()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ class UnusedVarPass(private val uniqueWarningLogger: Logger) : ProcedurePass {
lastEdges = edges

usedVars.clear()
usedVars.addAll(
builder.parent.getProcedures().flatMap {
it.getParams().filter { it.second != ParamDirection.IN }.map { it.first }
}
)
edges.forEach { edge ->
usedVars.addAll(
edge.label.collectVarsWithAccessType().filter { it.value.isRead }.map { it.key }
Expand Down

0 comments on commit b772fc9

Please sign in to comment.