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 { ...@@ -26,12 +26,15 @@ object AntiAliasingPhase extends TransformationPhase {
val effects = effectsAnalysis(pgm) 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 { val varsInScope: Map[FunDef, Set[Identifier]] = (for {
fd <- fds fd <- fds
} yield { } yield {
val allFreeVars = fd.body.map(bd => variablesOf(bd)).getOrElse(Set()) val allFreeVars = fd.body.map(bd => variablesOf(bd)).getOrElse(Set())
val freeVars = allFreeVars -- fd.params.map(_.id) val freeVars = allFreeVars -- fd.params.map(_.id)
(fd, freeVars) val mutableFreeVars = freeVars.filter(id => id.getType.isInstanceOf[ArrayType])
(fd, mutableFreeVars)
}).toMap }).toMap
/* /*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment