aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/tasty/TreeBuffer.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/dotty/tools/dotc/core/tasty/TreeBuffer.scala')
-rw-r--r--src/dotty/tools/dotc/core/tasty/TreeBuffer.scala4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/core/tasty/TreeBuffer.scala b/src/dotty/tools/dotc/core/tasty/TreeBuffer.scala
index d741c42c3..f8f7c330f 100644
--- a/src/dotty/tools/dotc/core/tasty/TreeBuffer.scala
+++ b/src/dotty/tools/dotc/core/tasty/TreeBuffer.scala
@@ -6,7 +6,7 @@ package tasty
import util.Util.{bestFit, dble}
import TastyBuffer.{Addr, AddrWidth}
import config.Printers.pickling
-import ast.tpd.Tree
+import ast.untpd.Tree
class TreeBuffer extends TastyBuffer(50000) {
@@ -19,6 +19,8 @@ class TreeBuffer extends TastyBuffer(50000) {
private[tasty] val pickledTrees = new java.util.IdentityHashMap[Tree, Any] // Value type is really Addr, but that's not compatible with null
+ def registerTreeAddr(tree: Tree) = pickledTrees.put(tree, currentAddr)
+
def addrOfTree(tree: Tree): Option[Addr] = pickledTrees.get(tree) match {
case null => None
case n => Some(n.asInstanceOf[Addr])