diff options
author | Martin Odersky <odersky@gmail.com> | 2016-11-18 17:19:59 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2016-11-18 17:19:59 +0100 |
commit | 9bada400b36834e92484e416a5b9b41b10cbd5a5 (patch) | |
tree | e7d7af11cbf936895e43bc4855cec842c65c2b3e /src/dotty/tools | |
parent | 5979e36d7c206beb6abf53302462091fad834c76 (diff) | |
download | dotty-9bada400b36834e92484e416a5b9b41b10cbd5a5.tar.gz dotty-9bada400b36834e92484e416a5b9b41b10cbd5a5.tar.bz2 dotty-9bada400b36834e92484e416a5b9b41b10cbd5a5.zip |
More extensive stats about generated trees
Diffstat (limited to 'src/dotty/tools')
-rw-r--r-- | src/dotty/tools/dotc/Run.scala | 3 | ||||
-rw-r--r-- | src/dotty/tools/dotc/typer/FrontEnd.scala | 6 |
2 files changed, 6 insertions, 3 deletions
diff --git a/src/dotty/tools/dotc/Run.scala b/src/dotty/tools/dotc/Run.scala index f5ba56a7e..0f652ff0b 100644 --- a/src/dotty/tools/dotc/Run.scala +++ b/src/dotty/tools/dotc/Run.scala @@ -82,6 +82,9 @@ class Run(comp: Compiler)(implicit ctx: Context) { ctx.informTime(s"$phase ", start) } if (!ctx.reporter.hasErrors) Rewrites.writeBack() + for (unit <- units) + Stats.record("retained typed trees at end", unit.tpdTree.treeSize) + Stats.record("total trees at end", ast.Trees.ntrees) } private sealed trait PrintedTree diff --git a/src/dotty/tools/dotc/typer/FrontEnd.scala b/src/dotty/tools/dotc/typer/FrontEnd.scala index e24d1f25d..4f8bc55d8 100644 --- a/src/dotty/tools/dotc/typer/FrontEnd.scala +++ b/src/dotty/tools/dotc/typer/FrontEnd.scala @@ -49,8 +49,8 @@ class FrontEnd extends Phase { val unit = ctx.compilationUnit unit.tpdTree = ctx.typer.typedExpr(unit.untpdTree) typr.println("typed: " + unit.source) - record("retainedUntypedTrees", unit.untpdTree.treeSize) - record("retainedTypedTrees", unit.tpdTree.treeSize) + record("retained untyped trees", unit.untpdTree.treeSize) + record("retained typed trees after typer", unit.tpdTree.treeSize) } private def firstTopLevelDef(trees: List[tpd.Tree])(implicit ctx: Context): Symbol = trees match { @@ -72,7 +72,7 @@ class FrontEnd extends Phase { record("parsedTrees", ast.Trees.ntrees) unitContexts foreach (enterSyms(_)) unitContexts foreach (typeCheck(_)) - record("totalTrees", ast.Trees.ntrees) + record("total trees after typer", ast.Trees.ntrees) unitContexts.map(_.compilationUnit).filterNot(discardAfterTyper) } |