Skip to content

Commit

Permalink
made AnalyzeDepsPhase run only once
Browse files Browse the repository at this point in the history
  • Loading branch information
ittaiz committed Jan 15, 2017
1 parent 510896b commit 7686717
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/compiler/scala/tools/nsc/Global.scala
Expand Up @@ -660,7 +660,8 @@ class Global(var currentSettings: Settings, var reporter: Reporter)
}
private class AnalyzeDepsPhase(prev: Phase) extends GlobalPhase(prev) {
def name = phaseName
def apply(unit: CompilationUnit) {

override def run(): Unit = {
val entries = settings.classpath.value.split(":").map(s => new File(s))
def findEntry(p: File) = entries.find(e => p.getAbsolutePath.startsWith(e.getAbsolutePath))
val usedEntries = loaders.completedClassfiles.flatMap({
Expand All @@ -671,6 +672,10 @@ class Global(var currentSettings: Settings, var reporter: Reporter)
val unusedEntries = entries.diff(usedEntries)
unusedEntries.foreach(e => warning("unused classpath entry " + e))
}

def apply(unit: CompilationUnit) {
/*NOP since this is run once for all units. We override run to not call this*/
}
}
}

Expand Down

0 comments on commit 7686717

Please sign in to comment.