aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-03-15 11:43:00 +0100
committerMartin Odersky <odersky@gmail.com>2016-04-01 11:20:18 +0200
commit4ab16677e1ccc469fe17b313dc48fd8427418fc7 (patch)
tree2acf4ff18b85c778d506d1579e71312b2a389ef9 /src/dotty/tools
parent1c48c1f8a0ff8f94652a98992d13fa47207a79d4 (diff)
downloaddotty-4ab16677e1ccc469fe17b313dc48fd8427418fc7.tar.gz
dotty-4ab16677e1ccc469fe17b313dc48fd8427418fc7.tar.bz2
dotty-4ab16677e1ccc469fe17b313dc48fd8427418fc7.zip
Better documentation of main classes
Diffstat (limited to 'src/dotty/tools')
-rw-r--r--src/dotty/tools/dotc/Bench.scala4
-rw-r--r--src/dotty/tools/dotc/Compiler.scala3
-rw-r--r--src/dotty/tools/dotc/Main.scala3
-rw-r--r--src/dotty/tools/dotc/Resident.scala4
-rw-r--r--src/dotty/tools/dotc/Run.scala1
5 files changed, 12 insertions, 3 deletions
diff --git a/src/dotty/tools/dotc/Bench.scala b/src/dotty/tools/dotc/Bench.scala
index 2fc38d78c..56b6dabbe 100644
--- a/src/dotty/tools/dotc/Bench.scala
+++ b/src/dotty/tools/dotc/Bench.scala
@@ -8,6 +8,10 @@ package dotc
import core.Contexts.Context
import reporting.Reporter
+/** A main class for running compiler benchmarks. Can instantiate a given
+ * number of compilers and run each (sequentially) a given number of times
+ * on the same sources.
+ */
object Bench extends Driver {
@sharable private var numRuns = 1
diff --git a/src/dotty/tools/dotc/Compiler.scala b/src/dotty/tools/dotc/Compiler.scala
index 62507d11a..fe48ac30e 100644
--- a/src/dotty/tools/dotc/Compiler.scala
+++ b/src/dotty/tools/dotc/Compiler.scala
@@ -18,6 +18,9 @@ import core.Denotations.SingleDenotation
import dotty.tools.backend.jvm.{LabelDefs, GenBCode}
import dotty.tools.backend.sjs.GenSJSIR
+/** The central class of the dotc compiler. The job of a compiler is to create
+ * runs, which process given `phases` in a given `rootContext`.
+ */
class Compiler {
/** Meta-ordering constraint:
diff --git a/src/dotty/tools/dotc/Main.scala b/src/dotty/tools/dotc/Main.scala
index 6c473d8bb..a6844fbbc 100644
--- a/src/dotty/tools/dotc/Main.scala
+++ b/src/dotty/tools/dotc/Main.scala
@@ -3,8 +3,7 @@ package dotc
import core.Contexts.Context
-/* To do:
- */
+/** Main class of the `dotc` batch compiler. */
object Main extends Driver {
override def newCompiler(implicit ctx: Context): Compiler = new Compiler
}
diff --git a/src/dotty/tools/dotc/Resident.scala b/src/dotty/tools/dotc/Resident.scala
index e1b62e4d0..56f6684d0 100644
--- a/src/dotty/tools/dotc/Resident.scala
+++ b/src/dotty/tools/dotc/Resident.scala
@@ -6,7 +6,9 @@ import reporting.Reporter
import java.io.EOFException
import scala.annotation.tailrec
-/** A compiler which stays resident between runs.
+/** A compiler which stays resident between runs. This is more of a PoC than
+ * something that's expected to be used often
+ *
* Usage:
*
* > scala dotty.tools.dotc.Resident <options> <initial files>
diff --git a/src/dotty/tools/dotc/Run.scala b/src/dotty/tools/dotc/Run.scala
index ee808323a..7a0e555e4 100644
--- a/src/dotty/tools/dotc/Run.scala
+++ b/src/dotty/tools/dotc/Run.scala
@@ -13,6 +13,7 @@ import java.io.{BufferedWriter, OutputStreamWriter}
import scala.reflect.io.VirtualFile
import scala.util.control.NonFatal
+/** A compiler run. Exports various methods to compile source files */
class Run(comp: Compiler)(implicit ctx: Context) {
assert(comp.phases.last.last.id <= Periods.MaxPossiblePhaseId)