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 @@ -50,8 +50,11 @@ class GenBCode extends Phase {
50
50
new PlainDirectory (new Directory (new JFile (ctx.settings.d.value)))
51
51
52
52
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
55
58
entryPoints.clear()
56
59
}
57
60
}
Original file line number Diff line number Diff line change @@ -21,6 +21,11 @@ import java.util.HashMap
21
21
object Names {
22
22
import NameKinds ._
23
23
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
+
24
29
/** A common class for things that can be turned into names.
25
30
* Instances are both names and strings, the latter via a decorator.
26
31
*/
@@ -287,7 +292,11 @@ object Names {
287
292
override def hashCode : Int = start
288
293
289
294
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
+ }
291
300
292
301
def debugString : String = toString
293
302
}
You can’t perform that action at this time.
0 commit comments