diff options
author | Seth Tisue <seth@tisue.net> | 2015-06-18 06:11:50 -0400 |
---|---|---|
committer | Seth Tisue <seth@tisue.net> | 2015-06-18 06:11:50 -0400 |
commit | b7038a77a1e4128446dd7f863b0698d52f3ed4b7 (patch) | |
tree | f7fe099eeaf47ee5a9a0a7d8479999fe5b5e1fb9 | |
parent | 5199cdffa86b98949f29fa7efb6b31778724b02c (diff) | |
parent | 9368663aa281a43789f124dbaf8e70128dafd46d (diff) | |
download | scala-b7038a77a1e4128446dd7f863b0698d52f3ed4b7.tar.gz scala-b7038a77a1e4128446dd7f863b0698d52f3ed4b7.tar.bz2 scala-b7038a77a1e4128446dd7f863b0698d52f3ed4b7.zip |
Merge pull request #4543 from som-snytt/issue/7773
SI-7773 Restore phase id to icode filename
-rw-r--r-- | src/compiler/scala/tools/nsc/Global.scala | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/compiler/scala/tools/nsc/Global.scala b/src/compiler/scala/tools/nsc/Global.scala index 4430a84f06..3469726455 100644 --- a/src/compiler/scala/tools/nsc/Global.scala +++ b/src/compiler/scala/tools/nsc/Global.scala @@ -1675,23 +1675,25 @@ class Global(var currentSettings: Settings, var reporter: Reporter) def getFile(clazz: Symbol, suffix: String): File = getFile(clazz.sourceFile, clazz.fullName split '.', suffix) private def writeICode() { - val printer = new icodes.TextPrinter(null, icodes.linearizer) - icodes.classes.values.foreach((cls) => { - val moduleSfx = if (cls.symbol.hasModuleFlag) "$" else "" - val phaseSfx = if (settings.debug) phase else "" // only for debugging, appending the full phasename breaks windows build - val file = getFile(cls.symbol, s"$moduleSfx$phaseSfx.icode") + val printer = new icodes.TextPrinter(writer = null, icodes.linearizer) + icodes.classes.values foreach { cls => + val file = { + val module = if (cls.symbol.hasModuleFlag) "$" else "" + val faze = if (settings.debug) phase.name else f"${phase.id}%02d" // avoid breaking windows build with long filename + getFile(cls.symbol, s"$module-$faze.icode") + } try { val stream = new FileOutputStream(file) printer.setWriter(new PrintWriter(stream, true)) printer.printClass(cls) - informProgress("wrote " + file) + informProgress(s"wrote $file") } catch { - case ex: IOException => - if (settings.debug) ex.printStackTrace() - globalError("could not write file " + file) + case e: IOException => + if (settings.debug) e.printStackTrace() + globalError(s"could not write file $file") } - }) + } } def createJavadoc = false } |