File tree 2 files changed +15
-3
lines changed
2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -52,8 +52,11 @@ class GenBCode extends Phase {
52
52
new PlainDirectory (new Directory (new JFile (ctx.settings.d.value)))
53
53
54
54
def run (implicit ctx : Context ): Unit = {
55
- new GenBCodePipeline (entryPoints.toList,
56
- new DottyBackendInterface (outputDir, superCallsMap.toMap)(ctx))(ctx).run(ctx.compilationUnit.tpdTree)
55
+ val saved = Names .useMangled
56
+ Names .useMangled = true
57
+ try new GenBCodePipeline (entryPoints.toList,
58
+ new DottyBackendInterface (outputDir, superCallsMap.toMap)(ctx))(ctx).run(ctx.compilationUnit.tpdTree)
59
+ finally Names .useMangled = saved
57
60
entryPoints.clear()
58
61
}
59
62
}
Original file line number Diff line number Diff line change @@ -22,6 +22,11 @@ import java.util.HashMap
22
22
object Names {
23
23
import NameKinds ._
24
24
25
+ // Gross hack because the backend uses toString on arbitrary names, which means
26
+ // that the NameHelper abstraction is leaky. As long as cannot get rid of this,
27
+ // parallel compilation is impossible.
28
+ @ sharable var useMangled : Boolean = false
29
+
25
30
/** A common class for things that can be turned into names.
26
31
* Instances are both names and strings, the latter via a decorator.
27
32
*/
@@ -295,7 +300,11 @@ object Names {
295
300
override def hashCode : Int = start
296
301
297
302
override def toString =
298
- if (length == 0 ) " " else new String (chrs, start, length)
303
+ if (length == 0 ) " "
304
+ else {
305
+ val n = if (useMangled) mangled.asSimpleName else this
306
+ new String (chrs, n.start, n.length)
307
+ }
299
308
300
309
def sliceToString (from : Int , end : Int ) =
301
310
if (end <= from) " " else new String (chrs, start + from, end - from)
You can’t perform that action at this time.
0 commit comments