diff options
author | Martin Odersky <odersky@gmail.com> | 2015-02-23 13:51:37 +0100 |
---|---|---|
committer | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2015-03-18 11:14:09 +0100 |
commit | 8fea2ef8368dc1bf82bb8064dd17368c38bb2347 (patch) | |
tree | 60b605f49adc839880fee922a08aca6d659dd074 /src/dotty/tools/dotc/core/pickling/TreePickler.scala | |
parent | 4115edaa883f753b675373cbee4997e0cfb889e5 (diff) | |
download | dotty-8fea2ef8368dc1bf82bb8064dd17368c38bb2347.tar.gz dotty-8fea2ef8368dc1bf82bb8064dd17368c38bb2347.tar.bz2 dotty-8fea2ef8368dc1bf82bb8064dd17368c38bb2347.zip |
Record pickled trees in a hashmap
The idea is that we want to use the mapping from tree to Addr
in other sections, most immeditaely for positions, but it could
be others as well.
Diffstat (limited to 'src/dotty/tools/dotc/core/pickling/TreePickler.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/pickling/TreePickler.scala | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/core/pickling/TreePickler.scala b/src/dotty/tools/dotc/core/pickling/TreePickler.scala index 32eb5f47f..0e6c45d30 100644 --- a/src/dotty/tools/dotc/core/pickling/TreePickler.scala +++ b/src/dotty/tools/dotc/core/pickling/TreePickler.scala @@ -10,7 +10,7 @@ import Contexts._, Symbols._, Types._, Names._, Constants._, Decorators._, Annot import collection.mutable import TastyBuffer._ -class TreePickler(pickler: TastyPickler, picklePositions: Boolean) { +class TreePickler(pickler: TastyPickler) { val buf = new TreeBuffer pickler.newSection("ASTs", buf) import buf._ @@ -244,6 +244,7 @@ class TreePickler(pickler: TastyPickler, picklePositions: Boolean) { if (!tree.isEmpty) pickleTree(tree) def pickleTree(tree: Tree): Unit = try { + pickledTrees.put(tree, currentAddr) tree match { case Ident(name) => tree.tpe match { @@ -468,5 +469,6 @@ class TreePickler(pickler: TastyPickler, picklePositions: Boolean) { pickleTree(tree) assert(forwardSymRefs.isEmpty, i"unresolved symbols: ${forwardSymRefs.keySet.toList}%, %") + compactify() } } |