Skip to content

Commit 6c33431

Browse files
authored
Merge pull request #4907 from dotty-staging/remove-link-all
Remove -Xlink
2 parents 6485f89 + 22fbed0 commit 6c33431

File tree

10 files changed

+12
-192
lines changed

10 files changed

+12
-192
lines changed

compiler/src/dotty/tools/dotc/Compiler.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ class Compiler {
5252
/** Phases dealing with TASTY tree pickling and unpickling */
5353
protected def picklerPhases: List[List[Phase]] =
5454
List(new Pickler) :: // Generate TASTY info
55-
List(new LinkAll) :: // Reload compilation units from TASTY for library code (if needed)
5655
List(new ReifyQuotes) :: // Turn quoted trees into explicit run-time data structures
5756
Nil
5857

compiler/src/dotty/tools/dotc/config/ScalaSettings.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,6 @@ class ScalaSettings extends Settings.SettingGroup {
144144
val YshowVarBounds = BooleanSetting("-Yshow-var-bounds", "Print type variables with their bounds")
145145
val YshowNoInline = BooleanSetting("-Yshow-no-inline", "Show inlined code without the 'inlined from' info")
146146

147-
/** Linker specific flags */
148-
val Xlink = BooleanSetting("-Xlink", "Recompile library code with the application.")
149147
val YnoDecodeStacktraces = BooleanSetting("-Yno-decode-stacktraces", "Show raw StackOverflow stacktraces, instead of decoding them into triggering operations.")
150148

151149
/** Dottydoc specific settings */

compiler/src/dotty/tools/dotc/core/SymbolLoaders.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ class ClassfileLoader(val classfile: AbstractFile) extends SymbolLoader {
390390
}
391391

392392
private def mayLoadTreesFromTasty(implicit ctx: Context): Boolean =
393-
ctx.settings.YretainTrees.value || ctx.settings.Xlink.value || ctx.settings.fromTasty.value
393+
ctx.settings.YretainTrees.value || ctx.settings.fromTasty.value
394394
}
395395

396396
class SourcefileLoader(val srcfile: AbstractFile) extends SymbolLoader {

compiler/src/dotty/tools/dotc/core/Symbols.scala

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -668,10 +668,8 @@ object Symbols {
668668

669669
private[this] var myTree: TreeOrProvider = tpd.EmptyTree
670670

671-
/** If this is either:
672-
* - a top-level class and `-Yretain-trees` is set
673-
* - a top-level class loaded from TASTY and `-tasty` or `-Xlink` is set
674-
* then return the TypeDef tree (possibly wrapped inside PackageDefs) for this class, otherwise EmptyTree.
671+
/** If this is a top-level class and `-Yretain-trees` (or `-from-tasty`) is set.
672+
* Returns the TypeDef tree (possibly wrapped inside PackageDefs) for this class, otherwise EmptyTree.
675673
* This will force the info of the class.
676674
*/
677675
def tree(implicit ctx: Context): Tree = treeContaining("")

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

Lines changed: 0 additions & 82 deletions
This file was deleted.

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class ReifyQuotes extends MacroTransformWithImplicits {
7272
myMacroClassLoader
7373
}
7474

75-
override def phaseName: String = "reifyQuotes"
75+
override def phaseName: String = ReifyQuotes.name
7676

7777
override def checkPostCondition(tree: Tree)(implicit ctx: Context): Unit = {
7878
tree match {
@@ -607,6 +607,8 @@ class ReifyQuotes extends MacroTransformWithImplicits {
607607
}
608608

609609
object ReifyQuotes {
610+
val name = "reifyQuotes"
611+
610612
def toValue(tree: Tree): Option[Any] = tree match {
611613
case Literal(Constant(c)) => Some(c)
612614
case Block(Nil, e) => toValue(e)

compiler/test/dotty/tools/dotc/LinkTests.scala

Lines changed: 0 additions & 95 deletions
This file was deleted.

docs/docs/reference/changed/compiler-plugins.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ import dotty.tools.dotc.core.Decorators._
6060
import dotty.tools.dotc.core.StdNames._
6161
import dotty.tools.dotc.core.Symbols._
6262
import dotty.tools.dotc.plugins.{PluginPhase, StandardPlugin}
63-
import dotty.tools.dotc.transform.{LinkAll, Pickler}
63+
import dotty.tools.dotc.transform.{Pickler, ReifyQuotes}
6464

6565
class DivideZero extends StandardPlugin {
6666
val name: String = "divideZero"
@@ -75,7 +75,7 @@ class DivideZeroPhase extends PluginPhase {
7575
val phaseName = "divideZero"
7676

7777
override val runsAfter = Set(Pickler.name)
78-
override val runsBefore = Set(LinkAll.name)
78+
override val runsBefore = Set(ReifyQuotes.name)
7979

8080
override def transformApply(tree: Apply)(implicit ctx: Context): Tree = {
8181
tree match {

sbt-dotty/sbt-test/sbt-dotty/compiler-plugin/plugin/DivideZero.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import transform.MegaPhase.MiniPhase
1010
import Decorators._
1111
import Symbols.Symbol
1212
import Constants.Constant
13-
import transform.{LinkAll, Pickler}
13+
import transform.{Pickler, ReifyQuotes}
1414

1515
/** Compiler plugin that emits an error when compiling a division by zero */
1616
class DivideZero extends PluginPhase with StandardPlugin {
@@ -20,7 +20,7 @@ class DivideZero extends PluginPhase with StandardPlugin {
2020
val phaseName = name
2121

2222
override val runsAfter = Set(Pickler.name)
23-
override val runsBefore = Set(LinkAll.name)
23+
override val runsBefore = Set(ReifyQuotes.name)
2424

2525
def init(options: List[String]): List[PluginPhase] = this :: Nil
2626

tests/plugins/neg/divideZero/plugin_1.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import transform.MegaPhase.MiniPhase
88
import Decorators._
99
import Symbols.Symbol
1010
import Constants.Constant
11-
import transform.{LinkAll, Pickler}
11+
import transform.{Pickler, ReifyQuotes}
1212
import StdNames._
1313

1414
class DivideZero extends PluginPhase with StandardPlugin {
@@ -18,7 +18,7 @@ class DivideZero extends PluginPhase with StandardPlugin {
1818
val phaseName = name
1919

2020
override val runsAfter = Set(Pickler.name)
21-
override val runsBefore = Set(LinkAll.name)
21+
override val runsBefore = Set(ReifyQuotes.name)
2222

2323
override def init(options: List[String]): List[PluginPhase] = this :: Nil
2424

0 commit comments

Comments
 (0)