summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/transform
diff options
context:
space:
mode:
authorLukas Rytz <lukas.rytz@gmail.com>2016-02-15 16:56:48 +0100
committerLukas Rytz <lukas.rytz@gmail.com>2016-02-16 16:43:34 +0100
commitb7626d998ee415271105450f125c507629b8eae2 (patch)
treefd201d898e7d67dbdabdd116f1f27710718b98d6 /src/compiler/scala/tools/nsc/transform
parentce3a8030fa59e5a9082528bf6f1ffc12a9277bc9 (diff)
downloadscala-b7626d998ee415271105450f125c507629b8eae2.tar.gz
scala-b7626d998ee415271105450f125c507629b8eae2.tar.bz2
scala-b7626d998ee415271105450f125c507629b8eae2.zip
Remove -Y settings that are no longer used in 2.12
Added a deprecation warning for `-optimize`. Later we'll also graduate `-Yopt` to `-opt`, probably for 2.12.0-M5.
Diffstat (limited to 'src/compiler/scala/tools/nsc/transform')
-rw-r--r--src/compiler/scala/tools/nsc/transform/CleanUp.scala18
-rw-r--r--src/compiler/scala/tools/nsc/transform/Delambdafy.scala4
-rw-r--r--src/compiler/scala/tools/nsc/transform/LambdaLift.scala5
-rw-r--r--src/compiler/scala/tools/nsc/transform/UnCurry.scala5
4 files changed, 7 insertions, 25 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/CleanUp.scala b/src/compiler/scala/tools/nsc/transform/CleanUp.scala
index 112dedce81..0fb6213d36 100644
--- a/src/compiler/scala/tools/nsc/transform/CleanUp.scala
+++ b/src/compiler/scala/tools/nsc/transform/CleanUp.scala
@@ -21,16 +21,8 @@ abstract class CleanUp extends Statics with Transform with ast.TreeDSL {
val phaseName: String = "cleanup"
/* used in GenBCode: collects ClassDef symbols owning a main(Array[String]) method */
- private var entryPoints: List[Symbol] = null
- def getEntryPoints: List[Symbol] = {
- assert(settings.isBCodeActive, "Candidate Java entry points are collected here only when GenBCode in use.")
- entryPoints sortBy ("" + _.fullName) // For predictably ordered error messages.
- }
-
- override def newPhase(prev: scala.tools.nsc.Phase): StdPhase = {
- entryPoints = if (settings.isBCodeActive) Nil else null;
- super.newPhase(prev)
- }
+ private var entryPoints: List[Symbol] = Nil
+ def getEntryPoints: List[Symbol] = entryPoints sortBy ("" + _.fullName) // For predictably ordered error messages.
protected def newTransformer(unit: CompilationUnit): Transformer =
new CleanUpTransformer(unit)
@@ -378,11 +370,7 @@ abstract class CleanUp extends Statics with Transform with ast.TreeDSL {
}
override def transform(tree: Tree): Tree = tree match {
-
- case _: ClassDef
- if (entryPoints != null) &&
- genBCode.isJavaEntryPoint(tree.symbol, currentUnit)
- =>
+ case _: ClassDef if genBCode.isJavaEntryPoint(tree.symbol, currentUnit) =>
// collecting symbols for entry points here (as opposed to GenBCode where they are used)
// has the advantage of saving an additional pass over all ClassDefs.
entryPoints ::= tree.symbol
diff --git a/src/compiler/scala/tools/nsc/transform/Delambdafy.scala b/src/compiler/scala/tools/nsc/transform/Delambdafy.scala
index f15d05f7df..9825efdc67 100644
--- a/src/compiler/scala/tools/nsc/transform/Delambdafy.scala
+++ b/src/compiler/scala/tools/nsc/transform/Delambdafy.scala
@@ -570,8 +570,6 @@ abstract class Delambdafy extends Transform with TypingTransformers with ast.Tre
// The functional interface that can be used to adapt the lambda target method `target` to the
// given function type. Returns `NoSymbol` if the compiler settings are unsuitable.
private def java8CompatFunctionalInterface(target: Symbol, functionType: Type): (Symbol, Boolean) = {
- val canUseLambdaMetafactory = settings.isBCodeActive
-
val sym = functionType.typeSymbol
val pack = currentRun.runDefinitions.Scala_Java8_CompatPackage
val name1 = specializeTypes.specializedFunctionName(sym, functionType.typeArgs)
@@ -583,6 +581,6 @@ abstract class Delambdafy extends Transform with TypingTransformers with ast.Tre
} else {
pack.info.decl(name1.toTypeName.prepend("J"))
}
- (if (canUseLambdaMetafactory) functionalInterface else NoSymbol, isSpecialized)
+ (functionalInterface, isSpecialized)
}
}
diff --git a/src/compiler/scala/tools/nsc/transform/LambdaLift.scala b/src/compiler/scala/tools/nsc/transform/LambdaLift.scala
index f6e2dd68f0..a372136781 100644
--- a/src/compiler/scala/tools/nsc/transform/LambdaLift.scala
+++ b/src/compiler/scala/tools/nsc/transform/LambdaLift.scala
@@ -246,9 +246,8 @@ abstract class LambdaLift extends InfoTransform {
}
// make sure that the name doesn't make the symbol accidentally `isAnonymousClass` (et.al) by
- // introducing `$anon` in its name. to be cautious, we don't make this change in the default
- // backend under 2.11.x, so only in GenBCode.
- def nonAnon(s: String) = if (settings.Ybackend.value == "GenBCode") nme.ensureNonAnon(s) else s
+ // introducing `$anon` in its name.
+ def nonAnon(s: String) = nme.ensureNonAnon(s)
def newName(sym: Symbol): Name = {
val originalName = sym.name
diff --git a/src/compiler/scala/tools/nsc/transform/UnCurry.scala b/src/compiler/scala/tools/nsc/transform/UnCurry.scala
index 7cd05b56c3..eea1f53cbc 100644
--- a/src/compiler/scala/tools/nsc/transform/UnCurry.scala
+++ b/src/compiler/scala/tools/nsc/transform/UnCurry.scala
@@ -236,10 +236,7 @@ abstract class UnCurry extends InfoTransform
!(specialized =:= fun.tpe)
}
- def canUseDelamdafyMethod = (
- (inConstructorFlag == 0) // Avoiding synthesizing code prone to SI-6666, SI-8363 by using old-style lambda translation
- && (!isSpecialized || settings.isBCodeActive) // DelambdafyTransformer currently only emits generic FunctionN-s, use the old style in the meantime
- )
+ def canUseDelamdafyMethod = inConstructorFlag == 0 // Avoiding synthesizing code prone to SI-6666, SI-8363 by using old-style lambda translation
if (inlineFunctionExpansion || !canUseDelamdafyMethod) {
val parents = addSerializable(abstractFunctionForFunctionType(fun.tpe))
val anonClass = fun.symbol.owner newAnonymousFunctionClass(fun.pos, inConstructorFlag) addAnnotation SerialVersionUIDAnnotation