File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed
Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -50,8 +50,11 @@ class GenBCode extends Phase {
5050 new PlainDirectory (new Directory (new JFile (ctx.settings.d.value)))
5151
5252 def run (implicit ctx : Context ): Unit = {
53- new GenBCodePipeline (entryPoints.toList,
54- new DottyBackendInterface (outputDir, superCallsMap.toMap)(ctx))(ctx).run(ctx.compilationUnit.tpdTree)
53+ val saved = Names .useMangled
54+ Names .useMangled = true
55+ try new GenBCodePipeline (entryPoints.toList,
56+ new DottyBackendInterface (outputDir, superCallsMap.toMap)(ctx))(ctx).run(ctx.compilationUnit.tpdTree)
57+ finally Names .useMangled = saved
5558 entryPoints.clear()
5659 }
5760}
Original file line number Diff line number Diff line change @@ -21,6 +21,11 @@ import java.util.HashMap
2121object Names {
2222 import NameKinds ._
2323
24+ // Gross hack because the backend uses toString on arbitrary names, which means
25+ // that the NameHelper abstraction is leaky. As long as cannot get rid of this,
26+ // parallel compilation is impossible.
27+ @ sharable var useMangled : Boolean = false
28+
2429 /** A common class for things that can be turned into names.
2530 * Instances are both names and strings, the latter via a decorator.
2631 */
@@ -287,7 +292,11 @@ object Names {
287292 override def hashCode : Int = start
288293
289294 override def toString =
290- if (length == 0 ) " " else new String (chrs, start, length)
295+ if (length == 0 ) " "
296+ else {
297+ val n = if (useMangled) mangled.asSimpleName else this
298+ new String (chrs, n.start, n.length)
299+ }
291300
292301 def debugString : String = toString
293302 }
You can’t perform that action at this time.
0 commit comments