aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/backend/jvm/GenBCode.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/dotty/tools/backend/jvm/GenBCode.scala')
-rw-r--r--src/dotty/tools/backend/jvm/GenBCode.scala11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/dotty/tools/backend/jvm/GenBCode.scala b/src/dotty/tools/backend/jvm/GenBCode.scala
index feaae036b..e8d196ce7 100644
--- a/src/dotty/tools/backend/jvm/GenBCode.scala
+++ b/src/dotty/tools/backend/jvm/GenBCode.scala
@@ -23,6 +23,7 @@ import Symbols._
import Denotations._
import Phases._
import java.lang.AssertionError
+import java.io.{ File => JFile }
import scala.tools.asm
import scala.tools.asm.tree._
import dotty.tools.dotc.util.{Positions, DotClass}
@@ -47,6 +48,8 @@ class GenBCodePipeline(val entryPoints: List[Symbol], val int: DottyBackendInter
var tree: Tree = _
+ val sourceJFile: JFile = ctx.compilationUnit.source.file.file
+
final class PlainClassBuilder(cunit: CompilationUnit) extends SyncAndTryBuilder(cunit)
@@ -300,6 +303,9 @@ class GenBCodePipeline(val entryPoints: List[Symbol], val int: DottyBackendInter
bytecodeWriter.close()
// Statistics.stopTimer(BackendStats.bcodeTimer, bcodeStart)
+ if (ctx.compilerCallback != null)
+ ctx.compilerCallback.onSourceCompiled(sourceJFile)
+
/* TODO Bytecode can be verified (now that all classfiles have been written to disk)
*
* (1) asm.util.CheckAdapter.verify()
@@ -363,6 +369,11 @@ class GenBCodePipeline(val entryPoints: List[Symbol], val int: DottyBackendInter
if (outFolder == null) null
else getFileForClassfile(outFolder, jclassName, ".class")
bytecodeWriter.writeClass(jclassName, jclassName, jclassBytes, outFile)
+
+ val outJFile = outFile.file
+ val className = jclassName.replace('/', '.')
+ if (ctx.compilerCallback != null)
+ ctx.compilerCallback.onClassGenerated(sourceJFile, outJFile, className)
}
catch {
case e: FileConflictException =>