Skip to content

Commit 4ab1667

Browse files
committed
Better documentation of main classes
1 parent 1c48c1f commit 4ab1667

File tree

5 files changed

+12
-3
lines changed

5 files changed

+12
-3
lines changed

src/dotty/tools/dotc/Bench.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ package dotc
88
import core.Contexts.Context
99
import reporting.Reporter
1010

11+
/** A main class for running compiler benchmarks. Can instantiate a given
12+
* number of compilers and run each (sequentially) a given number of times
13+
* on the same sources.
14+
*/
1115
object Bench extends Driver {
1216

1317
@sharable private var numRuns = 1

src/dotty/tools/dotc/Compiler.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ import core.Denotations.SingleDenotation
1818
import dotty.tools.backend.jvm.{LabelDefs, GenBCode}
1919
import dotty.tools.backend.sjs.GenSJSIR
2020

21+
/** The central class of the dotc compiler. The job of a compiler is to create
22+
* runs, which process given `phases` in a given `rootContext`.
23+
*/
2124
class Compiler {
2225

2326
/** Meta-ordering constraint:

src/dotty/tools/dotc/Main.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ package dotc
33

44
import core.Contexts.Context
55

6-
/* To do:
7-
*/
6+
/** Main class of the `dotc` batch compiler. */
87
object Main extends Driver {
98
override def newCompiler(implicit ctx: Context): Compiler = new Compiler
109
}

src/dotty/tools/dotc/Resident.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ import reporting.Reporter
66
import java.io.EOFException
77
import scala.annotation.tailrec
88

9-
/** A compiler which stays resident between runs.
9+
/** A compiler which stays resident between runs. This is more of a PoC than
10+
* something that's expected to be used often
11+
*
1012
* Usage:
1113
*
1214
* > scala dotty.tools.dotc.Resident <options> <initial files>

src/dotty/tools/dotc/Run.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import java.io.{BufferedWriter, OutputStreamWriter}
1313
import scala.reflect.io.VirtualFile
1414
import scala.util.control.NonFatal
1515

16+
/** A compiler run. Exports various methods to compile source files */
1617
class Run(comp: Compiler)(implicit ctx: Context) {
1718

1819
assert(comp.phases.last.last.id <= Periods.MaxPossiblePhaseId)

0 commit comments

Comments
 (0)