1
1
package dotty .tools .backend .jvm
2
2
3
- import scala .collection .mutable .Clearable
3
+ import scala .collection .mutable .{ Clearable , HashSet }
4
4
import dotty .tools .dotc .util .*
5
5
import dotty .tools .io .AbstractFile
6
6
import java .util .{Collection => JCollection , Map => JMap }
@@ -20,7 +20,7 @@ sealed abstract class PostProcessorFrontendAccess {
20
20
def getEntryPoints : List [String ]
21
21
22
22
private val frontendLock : AnyRef = new Object ()
23
- @ inline final def frontendSynch [T ](x : => T ): T = frontendLock.synchronized (x)
23
+ inline final def frontendSynch [T ](inline x : => T ): T = frontendLock.synchronized (x)
24
24
}
25
25
26
26
object PostProcessorFrontendAccess {
@@ -35,11 +35,12 @@ object PostProcessorFrontendAccess {
35
35
}
36
36
37
37
sealed trait BackendReporting {
38
- def error (message : String , pos : SourcePosition ): Unit
38
+ def error (message : String ): Unit
39
+ def warning (message : String ): Unit
39
40
def log (message : String ): Unit
40
41
}
41
42
42
- class Impl [I <: DottyBackendInterface ](val int : I ) extends PostProcessorFrontendAccess {
43
+ class Impl [I <: DottyBackendInterface ](val int : I , entryPoints : HashSet [ String ] ) extends PostProcessorFrontendAccess {
43
44
import int .given
44
45
lazy val compilerSettings : CompilerSettings = buildCompilerSettings()
45
46
@@ -67,13 +68,11 @@ object PostProcessorFrontendAccess {
67
68
}
68
69
69
70
object backendReporting extends BackendReporting {
70
- def error (message : String , pos : SourcePosition ): Unit = frontendSynch(report.error(message, pos))
71
+ def error (message : String ): Unit = frontendSynch(report.error(message, NoSourcePosition ))
72
+ def warning (message : String ): Unit = frontendSynch(report.warning(message, NoSourcePosition ))
71
73
def log (message : String ): Unit = frontendSynch(report.log(message))
72
74
}
73
75
74
- def getEntryPoints : List [String ] = frontendSynch(Phases .genBCodePhase match {
75
- case genBCode : GenBCode => genBCode.entryPoints.toList
76
- case _ => Nil
77
- })
76
+ def getEntryPoints : List [String ] = frontendSynch(entryPoints.toList)
78
77
}
79
78
}
0 commit comments