Skip to content
Snippets Groups Projects
Commit 838415e7 authored by Regis Blanc's avatar Regis Blanc
Browse files

only mutable vars are relevant for capture

parent d773400b
No related branches found
No related tags found
No related merge requests found
......@@ -26,12 +26,15 @@ object AntiAliasingPhase extends TransformationPhase {
val effects = effectsAnalysis(pgm)
//for each fun def, all the vars the the body captures. Only
//mutable types.
val varsInScope: Map[FunDef, Set[Identifier]] = (for {
fd <- fds
} yield {
val allFreeVars = fd.body.map(bd => variablesOf(bd)).getOrElse(Set())
val freeVars = allFreeVars -- fd.params.map(_.id)
(fd, freeVars)
val mutableFreeVars = freeVars.filter(id => id.getType.isInstanceOf[ArrayType])
(fd, mutableFreeVars)
}).toMap
/*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment