diff options
author | Martin Odersky <odersky@gmail.com> | 2016-09-04 15:01:05 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2016-10-02 16:11:21 +0200 |
commit | 333ec27c9e503f428c86a155351d11f332f2892d (patch) | |
tree | 99c9c9638de688e4a3369cedb61d9046427cc4b8 /src/dotty/tools/dotc/core/tasty/TastyPrinter.scala | |
parent | 688cc890ceadb42f742579494a560159334c85aa (diff) | |
download | dotty-333ec27c9e503f428c86a155351d11f332f2892d.tar.gz dotty-333ec27c9e503f428c86a155351d11f332f2892d.tar.bz2 dotty-333ec27c9e503f428c86a155351d11f332f2892d.zip |
Set the positions of inlined trees wehn read form Tasty
This required a major change in the way positions are handled, as the
previous scheme did not allow to read the positions of arbitrary subtrees
selectively.
Fortunately, it's altogether a major simplification.
Also, this fixed a bug in the previous scheme, where positions were
generated before compactification, resulting in addresses being wrong.
Diffstat (limited to 'src/dotty/tools/dotc/core/tasty/TastyPrinter.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/tasty/TastyPrinter.scala | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/core/tasty/TastyPrinter.scala b/src/dotty/tools/dotc/core/tasty/TastyPrinter.scala index 915ae3f21..7fcd7c29e 100644 --- a/src/dotty/tools/dotc/core/tasty/TastyPrinter.scala +++ b/src/dotty/tools/dotc/core/tasty/TastyPrinter.scala @@ -113,8 +113,8 @@ class TastyPrinter(bytes: Array[Byte])(implicit ctx: Context) { class PositionSectionUnpickler extends SectionUnpickler[Unit]("Positions") { def unpickle(reader: TastyReader, tastyName: TastyName.Table): Unit = { print(s"${reader.endAddr.index - reader.currentAddr.index}") - val (totalRange, positions) = new PositionUnpickler(reader).unpickle() - println(s" position bytes in $totalRange:") + val positions = new PositionUnpickler(reader).positions + println(s" position bytes:") val sorted = positions.toSeq.sortBy(_._1.index) for ((addr, pos) <- sorted) println(s"${addr.index}: ${offsetToInt(pos.start)} .. ${pos.end}") } |