aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/tasty
diff options
context:
space:
mode:
Diffstat (limited to 'src/dotty/tools/dotc/core/tasty')
-rw-r--r--src/dotty/tools/dotc/core/tasty/DottyUnpickler.scala19
-rw-r--r--src/dotty/tools/dotc/core/tasty/TastyFormat.scala2
2 files changed, 4 insertions, 17 deletions
diff --git a/src/dotty/tools/dotc/core/tasty/DottyUnpickler.scala b/src/dotty/tools/dotc/core/tasty/DottyUnpickler.scala
index afbf8ae07..0ad5d6966 100644
--- a/src/dotty/tools/dotc/core/tasty/DottyUnpickler.scala
+++ b/src/dotty/tools/dotc/core/tasty/DottyUnpickler.scala
@@ -6,7 +6,6 @@ package tasty
import Contexts._, SymDenotations._, Symbols._
import dotty.tools.dotc.ast.tpd
import TastyUnpickler._, TastyBuffer._
-import dotty.tools.dotc.core.tasty.DottyUnpickler.{SourceFileUnpickler, TreeSectionUnpickler, PositionsSectionUnpickler}
import util.Positions._
import util.{SourceFile, NoSource}
import PositionUnpickler._
@@ -18,13 +17,6 @@ object DottyUnpickler {
/** Exception thrown if classfile is corrupted */
class BadSignature(msg: String) extends RuntimeException(msg)
- class SourceFileUnpickler extends SectionUnpickler[SourceFile]("Sourcefile") {
- def unpickle(reader: TastyReader, tastyName: TastyName.Table) = {
- val TastyName.Simple(sourceName) = tastyName(reader.readNameRef())
- new SourceFile(sourceName.toString, Seq())
- }
- }
-
class TreeSectionUnpickler extends SectionUnpickler[TreeUnpickler]("ASTs") {
def unpickle(reader: TastyReader, tastyName: TastyName.Table) =
new TreeUnpickler(reader, tastyName)
@@ -41,27 +33,24 @@ object DottyUnpickler {
*/
class DottyUnpickler(bytes: Array[Byte]) extends ClassfileParser.Embedded {
import tpd._
+ import DottyUnpickler._
val unpickler = new TastyUnpickler(bytes)
private val treeUnpickler = unpickler.unpickle(new TreeSectionUnpickler).get
- private val source = unpickler.unpickle(new SourceFileUnpickler).getOrElse(NoSource)
/** Enter all toplevel classes and objects into their scopes
* @param roots a set of SymDenotations that should be overwritten by unpickling
*/
- def enter(roots: Set[SymDenotation])(implicit ctx: Context): Unit = {
+ def enter(roots: Set[SymDenotation])(implicit ctx: Context): Unit =
treeUnpickler.enterTopLevel(roots)
- if (source.exists)
- for (root <- roots) root.addAnnotation(Annotation.makeSourceFile(source.path))
- }
/** The unpickled trees, and the source file they come from
* @param readPositions if true, trees get decorated with position information.
*/
- def body(readPositions: Boolean = false)(implicit ctx: Context): (List[Tree], SourceFile) = {
+ def body(readPositions: Boolean = false)(implicit ctx: Context): List[Tree] = {
if (readPositions)
for ((totalRange, positions) <- unpickler.unpickle(new PositionsSectionUnpickler))
treeUnpickler.usePositions(totalRange, positions)
- (treeUnpickler.unpickle(), source)
+ treeUnpickler.unpickle()
}
}
diff --git a/src/dotty/tools/dotc/core/tasty/TastyFormat.scala b/src/dotty/tools/dotc/core/tasty/TastyFormat.scala
index a9f2e753f..ea7e985c9 100644
--- a/src/dotty/tools/dotc/core/tasty/TastyFormat.scala
+++ b/src/dotty/tools/dotc/core/tasty/TastyFormat.scala
@@ -184,8 +184,6 @@ Note: Tree tags are grouped into 5 categories that determine what follows, and t
Category 4 (tags 112-127): tag Nat AST
Category 5 (tags 128-255): tag Length <payload>
-Standard Section: "Sourcefile" sourcefile_NameRef
-
Standard Section: "Positions" sourceLength_Nat Assoc*
Assoc = addr_Delta offset_Delta offset_Delta?