Skip to content

Commit 88f6b65

Browse files
committed
Remove unused variables
# Conflicts: # compiler/src/dotty/tools/dotc/transform/Pickler.scala
1 parent c2755f1 commit 88f6b65

File tree

4 files changed

+4
-54
lines changed

4 files changed

+4
-54
lines changed

compiler/src/dotty/tools/dotc/core/quoted/PickledQuotes.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,6 @@ object PickledQuotes {
168168
val treePkl = pickler.treePkl
169169
treePkl.pickle(tree :: Nil)
170170
treePkl.compactify()
171-
pickler.addrOfTree = treePkl.buf.addrOfTree
172-
pickler.addrOfSym = treePkl.addrOfSym
173171
if (tree.span.exists)
174172
new PositionPickler(pickler, treePkl.buf.addrOfTree).picklePositions(tree :: Nil)
175173

compiler/src/dotty/tools/dotc/core/tasty/TastyPickler.scala

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -65,18 +65,5 @@ class TastyPickler(val rootCls: ClassSymbol) {
6565
all.bytes
6666
}
6767

68-
/** The address in the TASTY file of a given tree, or None if unknown.
69-
* Note that trees are looked up by reference equality,
70-
* so one can reliably use this function only directly after `pickler`.
71-
*/
72-
var addrOfTree: tpd.Tree => Addr = (_ => NoAddr)
73-
74-
/**
75-
* Addresses in TASTY file of symbols, stored by pickling.
76-
* Note that trees are checked for reference equality,
77-
* so one can reliably use this function only dirrectly after `pickler`
78-
*/
79-
var addrOfSym: Symbol => Option[Addr] = (_ => None)
80-
8168
val treePkl: TreePickler = new TreePickler(this)
8269
}

compiler/src/dotty/tools/dotc/core/tasty/TreeBuffer.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ class TreeBuffer extends TastyBuffer(50000) {
2121
private var delta: Array[Int] = _
2222
private var numOffsets = 0
2323

24-
/** A map from tree unique ids to the address index at which a tree is pickled. */
24+
/** A map from tree unique ids to the address index at which a tree is pickled.
25+
* Note that trees are looked up by reference equality,
26+
* so one can reliably use this function only directly after `pickler`.
27+
*/
2528
private val addrOfTree = SparseIntArray()
2629

2730
def registerTreeAddr(tree: Tree): Addr =

compiler/src/dotty/tools/dotc/transform/Pickler.scala

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -47,42 +47,6 @@ class Pickler extends Phase {
4747
clss.filterNot(companionModuleClasses.contains)
4848
}
4949

50-
class PickleCompleter:
51-
private var pickled: Array[Byte] = null
52-
53-
def complete(pickler: TastyPickler, cls: ClassSymbol, tree: Tree)(using Context): Unit =
54-
val treePkl = pickler.treePkl
55-
if tree.span.exists then
56-
new PositionPickler(pickler, treePkl.buf.addrOfTree).picklePositions(tree :: Nil)
57-
58-
if !ctx.settings.YdropComments.value then
59-
new CommentPickler(pickler, treePkl.buf.addrOfTree).pickleComment(tree)
60-
61-
val pickled = pickler.assembleParts()
62-
63-
def rawBytes = // not needed right now, but useful to print raw format.
64-
pickled.iterator.grouped(10).toList.zipWithIndex.map {
65-
case (row, i) => s"${i}0: ${row.mkString(" ")}"
66-
}
67-
68-
synchronized {
69-
this.pickled = pickled
70-
// println(i"rawBytes = \n$rawBytes%\n%") // DEBUG
71-
if pickling ne noPrinter then
72-
pickling.synchronized {
73-
println(i"**** pickled info of $cls")
74-
println(new TastyPrinter(pickled).printContents())
75-
}
76-
notifyAll()
77-
}
78-
end complete
79-
80-
def bytes: Array[Byte] = synchronized {
81-
if pickled == null then wait()
82-
pickled
83-
}
84-
end PickleCompleter
85-
8650
override def run(using Context): Unit = {
8751
val unit = ctx.compilationUnit
8852
pickling.println(i"unpickling in run ${ctx.runId}")
@@ -99,8 +63,6 @@ class Pickler extends Phase {
9963
val treePkl = pickler.treePkl
10064
treePkl.pickle(tree :: Nil)
10165
treePkl.compactify()
102-
pickler.addrOfTree = treePkl.buf.addrOfTree
103-
pickler.addrOfSym = treePkl.addrOfSym
10466
val pickledF = Future {
10567
if tree.span.exists then
10668
new PositionPickler(pickler, treePkl.buf.addrOfTree).picklePositions(tree :: Nil)

0 commit comments

Comments
 (0)