Revert "remove unneeded unlinking in compiler interface"

Unlinking is actually needed.

This reverts commit 1581d1b7e1.
This commit is contained in:
Mark Harrah 2012-06-02 19:03:57 -04:00
parent d9a8ec0c22
commit 4bc993e0ba
2 changed files with 17 additions and 0 deletions

View File

@ -44,6 +44,7 @@ final class Analyzer(val global: CallbackGlobal) extends Compat
classFile(on) match
{
case Some((f,className,inOutDir)) =>
if(inOutDir && on.isJavaDefined) registerTopLevelSym(on)
f match
{
case ze: ZipArchive#Entry => for(zip <- ze.underlyingSource; zipFile <- Option(zip.file) ) binaryDependency(zipFile, className)

View File

@ -172,6 +172,7 @@ private final class CachedCompiler0(args: Array[String], initialLog: WeakLog) ex
def clear()
{
callback0 = null
atPhase(currentRun.namerPhase) { forgetAll() }
superDropRun()
reporter = null
}
@ -188,6 +189,21 @@ private final class CachedCompiler0(args: Array[String], initialLog: WeakLog) ex
def findOnClassPath(name: String): Option[AbstractFile] =
classPath.findClass(name).flatMap(_.binary.asInstanceOf[Option[AbstractFile]])
override def registerTopLevelSym(sym: Symbol) = toForget += sym
final def unlinkAll(m: Symbol) {
val scope = m.owner.info.decls
scope unlink m
scope unlink m.companionSymbol
}
def forgetAll()
{
for(sym <- toForget)
unlinkAll(sym)
toForget = mutable.Set()
}
// fine-control over external changes is unimplemented:
// must drop whole CachedCompiler when !changes.isEmpty
def reload(changes: DependencyChanges)