Skip to content

Remove -Xlink #4907

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion compiler/src/dotty/tools/dotc/Compiler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ class Compiler {
/** Phases dealing with TASTY tree pickling and unpickling */
protected def picklerPhases: List[List[Phase]] =
List(new Pickler) :: // Generate TASTY info
List(new LinkAll) :: // Reload compilation units from TASTY for library code (if needed)
List(new ReifyQuotes) :: // Turn quoted trees into explicit run-time data structures
Nil

Expand Down
2 changes: 0 additions & 2 deletions compiler/src/dotty/tools/dotc/config/ScalaSettings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,6 @@ class ScalaSettings extends Settings.SettingGroup {
val YshowVarBounds = BooleanSetting("-Yshow-var-bounds", "Print type variables with their bounds")
val YshowNoInline = BooleanSetting("-Yshow-no-inline", "Show inlined code without the 'inlined from' info")

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

/** Dottydoc specific settings */
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/core/SymbolLoaders.scala
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ class ClassfileLoader(val classfile: AbstractFile) extends SymbolLoader {
}

private def mayLoadTreesFromTasty(implicit ctx: Context): Boolean =
ctx.settings.YretainTrees.value || ctx.settings.Xlink.value || ctx.settings.fromTasty.value
ctx.settings.YretainTrees.value || ctx.settings.fromTasty.value
}

class SourcefileLoader(val srcfile: AbstractFile) extends SymbolLoader {
Expand Down
6 changes: 2 additions & 4 deletions compiler/src/dotty/tools/dotc/core/Symbols.scala
Original file line number Diff line number Diff line change
Expand Up @@ -668,10 +668,8 @@ object Symbols {

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

/** If this is either:
* - a top-level class and `-Yretain-trees` is set
* - a top-level class loaded from TASTY and `-tasty` or `-Xlink` is set
* then return the TypeDef tree (possibly wrapped inside PackageDefs) for this class, otherwise EmptyTree.
/** If this is a top-level class and `-Yretain-trees` (or `-from-tasty`) is set.
* Returns the TypeDef tree (possibly wrapped inside PackageDefs) for this class, otherwise EmptyTree.
* This will force the info of the class.
*/
def tree(implicit ctx: Context): Tree = treeContaining("")
Expand Down
82 changes: 0 additions & 82 deletions compiler/src/dotty/tools/dotc/transform/LinkAll.scala

This file was deleted.

4 changes: 3 additions & 1 deletion compiler/src/dotty/tools/dotc/transform/ReifyQuotes.scala
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class ReifyQuotes extends MacroTransformWithImplicits {
myMacroClassLoader
}

override def phaseName: String = "reifyQuotes"
override def phaseName: String = ReifyQuotes.name

override def checkPostCondition(tree: Tree)(implicit ctx: Context): Unit = {
tree match {
Expand Down Expand Up @@ -607,6 +607,8 @@ class ReifyQuotes extends MacroTransformWithImplicits {
}

object ReifyQuotes {
val name = "reifyQuotes"

def toValue(tree: Tree): Option[Any] = tree match {
case Literal(Constant(c)) => Some(c)
case Block(Nil, e) => toValue(e)
Expand Down
95 changes: 0 additions & 95 deletions compiler/test/dotty/tools/dotc/LinkTests.scala

This file was deleted.

4 changes: 2 additions & 2 deletions docs/docs/reference/changed/compiler-plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ import dotty.tools.dotc.core.Decorators._
import dotty.tools.dotc.core.StdNames._
import dotty.tools.dotc.core.Symbols._
import dotty.tools.dotc.plugins.{PluginPhase, StandardPlugin}
import dotty.tools.dotc.transform.{LinkAll, Pickler}
import dotty.tools.dotc.transform.{Pickler, ReifyQuotes}

class DivideZero extends StandardPlugin {
val name: String = "divideZero"
Expand All @@ -75,7 +75,7 @@ class DivideZeroPhase extends PluginPhase {
val phaseName = "divideZero"

override val runsAfter = Set(Pickler.name)
override val runsBefore = Set(LinkAll.name)
override val runsBefore = Set(ReifyQuotes.name)

override def transformApply(tree: Apply)(implicit ctx: Context): Tree = {
tree match {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import transform.MegaPhase.MiniPhase
import Decorators._
import Symbols.Symbol
import Constants.Constant
import transform.{LinkAll, Pickler}
import transform.{Pickler, ReifyQuotes}

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

override val runsAfter = Set(Pickler.name)
override val runsBefore = Set(LinkAll.name)
override val runsBefore = Set(ReifyQuotes.name)

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

Expand Down
4 changes: 2 additions & 2 deletions tests/plugins/neg/divideZero/plugin_1.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import transform.MegaPhase.MiniPhase
import Decorators._
import Symbols.Symbol
import Constants.Constant
import transform.{LinkAll, Pickler}
import transform.{Pickler, ReifyQuotes}
import StdNames._

class DivideZero extends PluginPhase with StandardPlugin {
Expand All @@ -18,7 +18,7 @@ class DivideZero extends PluginPhase with StandardPlugin {
val phaseName = name

override val runsAfter = Set(Pickler.name)
override val runsBefore = Set(LinkAll.name)
override val runsBefore = Set(ReifyQuotes.name)

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

Expand Down