From 980a99cfa47157777539550a53b031f4f35a36c3 Mon Sep 17 00:00:00 2001 From: Lukas Rytz Date: Wed, 22 Oct 2008 12:49:56 +0000 Subject: reverting the unwanted parts of my last chekin.. --- src/compiler/scala/tools/ant/Scalac.scala | 8 +---- .../scala/tools/nsc/ast/TreeBrowsers.scala | 2 +- src/compiler/scala/tools/nsc/ast/Trees.scala | 35 +++++++--------------- src/compiler/scala/tools/nsc/symtab/Types.scala | 2 -- .../scala/tools/nsc/transform/InfoTransform.scala | 1 - .../scala/tools/nsc/transform/LambdaLift.scala | 2 -- .../scala/tools/nsc/transform/UnCurry.scala | 3 +- 7 files changed, 13 insertions(+), 40 deletions(-) diff --git a/src/compiler/scala/tools/ant/Scalac.scala b/src/compiler/scala/tools/ant/Scalac.scala index 5bbf52faf2..c15b45f091 100644 --- a/src/compiler/scala/tools/ant/Scalac.scala +++ b/src/compiler/scala/tools/ant/Scalac.scala @@ -455,10 +455,6 @@ class Scalac extends MatchingTask { ** Hooks for variants of Scala ** \*============================================================================*/ - protected def binaryEnding = backend match { - case Some("msil") => ".msil" - case _ => ".class" - } protected def newSettings(error: String=>Unit): Settings = new Settings(error) protected def newGlobal(settings: Settings, reporter: Reporter) = @@ -478,10 +474,8 @@ class Scalac extends MatchingTask { error("Attribute 'destdir' does not refer to an existing directory.") if (destination.isEmpty) destination = Some(getOrigin.head) - // TODO msil: map packages (will be in filename for .msil files). Use - // RegexppatternMapper (?) val mapper = new GlobPatternMapper() - mapper.setTo("*" + binaryEnding) + mapper.setTo("*.class") mapper.setFrom("*.scala") var javaOnly = true diff --git a/src/compiler/scala/tools/nsc/ast/TreeBrowsers.scala b/src/compiler/scala/tools/nsc/ast/TreeBrowsers.scala index 67cc057b03..94c19baa34 100644 --- a/src/compiler/scala/tools/nsc/ast/TreeBrowsers.scala +++ b/src/compiler/scala/tools/nsc/ast/TreeBrowsers.scala @@ -333,7 +333,7 @@ abstract class TreeBrowsers { ("Apply", EMPTY) case ApplyDynamic(qual, args) => - ("ApplyDynamic", EMPTY) + ("Apply", EMPTY) case Super(qualif, mix) => ("Super", qualif.toString() + ", mix: " + mix.toString()) diff --git a/src/compiler/scala/tools/nsc/ast/Trees.scala b/src/compiler/scala/tools/nsc/ast/Trees.scala index cdb62a6950..929f623c2d 100644 --- a/src/compiler/scala/tools/nsc/ast/Trees.scala +++ b/src/compiler/scala/tools/nsc/ast/Trees.scala @@ -1353,36 +1353,30 @@ trait Trees { } case ClassDef(mods, name, tparams, impl) => atOwner(tree.symbol) { - copy.ClassDef(tree, transformModifiers(mods), name, - transformTypeDefs(tparams), transformTemplate(impl)) + copy.ClassDef(tree, mods, name, transformTypeDefs(tparams), transformTemplate(impl)) } case ModuleDef(mods, name, impl) => atOwner(tree.symbol.moduleClass) { - copy.ModuleDef(tree, transformModifiers(mods), name, - transformTemplate(impl)) + copy.ModuleDef(tree, mods, name, transformTemplate(impl)) } case ValDef(mods, name, tpt, rhs) => atOwner(tree.symbol) { - copy.ValDef(tree, transformModifiers(mods), name, - transform(tpt), transform(rhs)) + copy.ValDef(tree, mods, name, transform(tpt), transform(rhs)) } case DefDef(mods, name, tparams, vparamss, tpt, rhs) => atOwner(tree.symbol) { copy.DefDef( - tree, transformModifiers(mods), name,transformTypeDefs(tparams), - transformValDefss(vparamss), transform(tpt), transform(rhs)) + tree, mods, name, transformTypeDefs(tparams), transformValDefss(vparamss), transform(tpt), transform(rhs)) } case TypeDef(mods, name, tparams, rhs) => atOwner(tree.symbol) { - copy.TypeDef(tree, transformModifiers(mods), name, - transformTypeDefs(tparams), transform(rhs)) + copy.TypeDef(tree, mods, name, transformTypeDefs(tparams), transform(rhs)) } case LabelDef(name, params, rhs) => copy.LabelDef(tree, name, transformIdents(params), transform(rhs)) //bq: Martin, once, atOwner(...) works, also change `LamdaLifter.proxy' case Import(expr, selectors) => copy.Import(tree, transform(expr), selectors) case Annotation(constr, elements) => -// println("transforming annotation: "+ this +"("+constr.getClass+")") copy.Annotation(tree, transform(constr), transformTrees(elements)) case DocDef(comment, definition) => copy.DocDef(tree, comment, transform(definition)) @@ -1482,9 +1476,6 @@ trait Trees { List.mapConserve(stats)(stat => if (exprOwner != currentOwner && stat.isTerm) atOwner(exprOwner)(transform(stat)) else transform(stat)) filter (EmptyTree !=) - def transformModifiers(mods: Modifiers): Modifiers = mods /* - Modifiers(mods.flags, mods.privateWithin, - mods.annotations.map(transform(_).asInstanceOf[Annotation])) */ def transformUnit(unit: CompilationUnit) { unit.body = transform(unit.body) } def atOwner[A](owner: Symbol)(trans: => A): A = { @@ -1507,35 +1498,29 @@ trait Trees { } case ClassDef(mods, name, tparams, impl) => atOwner(tree.symbol) { - traverseTrees(mods.annotations) - traverseTrees(tparams); traverse(impl) + traverseTrees(mods.annotations); traverseTrees(tparams); traverse(impl) } case ModuleDef(mods, name, impl) => atOwner(tree.symbol.moduleClass) { - traverseTrees(mods.annotations); - traverse(impl) + traverseTrees(mods.annotations); traverse(impl) } case ValDef(mods, name, tpt, rhs) => atOwner(tree.symbol) { - traverseTrees(mods.annotations); - traverse(tpt); traverse(rhs) + traverseTrees(mods.annotations); traverse(tpt); traverse(rhs) } case DefDef(mods, name, tparams, vparamss, tpt, rhs) => atOwner(tree.symbol) { - traverseTrees(mods.annotations); - traverseTrees(tparams); traverseTreess(vparamss); traverse(tpt); traverse(rhs) + traverseTrees(mods.annotations); traverseTrees(tparams); traverseTreess(vparamss); traverse(tpt); traverse(rhs) } case TypeDef(mods, name, tparams, rhs) => atOwner(tree.symbol) { - traverseTrees(mods.annotations); - traverseTrees(tparams); traverse(rhs) + traverseTrees(mods.annotations); traverseTrees(tparams); traverse(rhs) } case LabelDef(name, params, rhs) => traverseTrees(params); traverse(rhs) case Import(expr, selectors) => traverse(expr) case Annotation(constr, elements) => -// println("traversing annotation: "+ this +"("+constr.getClass+")") traverse(constr); traverseTrees(elements) case Annotated(annot, arg) => traverse(annot); traverse(arg) diff --git a/src/compiler/scala/tools/nsc/symtab/Types.scala b/src/compiler/scala/tools/nsc/symtab/Types.scala index 55adde0c46..0cb94b899f 100644 --- a/src/compiler/scala/tools/nsc/symtab/Types.scala +++ b/src/compiler/scala/tools/nsc/symtab/Types.scala @@ -2425,8 +2425,6 @@ A type's typeSymbol should never be inspected directly. // throw new Error("mapOver inapplicable for " + tp); } - /** Calls mapOver for the args, but with inverted variance for - * contravariant arguments */ def mapOverArgs(args: List[Type], tparams: List[Symbol]): List[Type] = map2Conserve(args, tparams) { (arg, tparam) => val v = variance diff --git a/src/compiler/scala/tools/nsc/transform/InfoTransform.scala b/src/compiler/scala/tools/nsc/transform/InfoTransform.scala index e5b3e87458..d130abb336 100644 --- a/src/compiler/scala/tools/nsc/transform/InfoTransform.scala +++ b/src/compiler/scala/tools/nsc/transform/InfoTransform.scala @@ -30,7 +30,6 @@ trait InfoTransform extends Transform { val pid = id val changesBaseClasses = InfoTransform.this.changesBaseClasses def transform(sym: Symbol, tpe: Type): Type = transformInfo(sym, tpe) - override def toString() = InfoTransform.this.toString() } infoTransformers.insert(infoTransformer) } diff --git a/src/compiler/scala/tools/nsc/transform/LambdaLift.scala b/src/compiler/scala/tools/nsc/transform/LambdaLift.scala index 5b4d3349b7..38be297d4c 100644 --- a/src/compiler/scala/tools/nsc/transform/LambdaLift.scala +++ b/src/compiler/scala/tools/nsc/transform/LambdaLift.scala @@ -194,7 +194,6 @@ abstract class LambdaLift extends InfoTransform { tree match { case ClassDef(_, _, _, _) => liftedDefs(tree.symbol) = new ListBuffer -// println("new lb for: "+ tree.symbol) if (sym.isLocal) renamable addEntry sym case DefDef(_, _, _, _, _, _) => if (sym.isLocal) { @@ -406,7 +405,6 @@ abstract class LambdaLift extends InfoTransform { val result = copy.ClassDef( stat, mods, name, tparams, copy.Template(impl, parents, self, body ::: lifted)) liftedDefs -= stat.symbol -// println("removed: "+ stat.symbol) result case _ => stat diff --git a/src/compiler/scala/tools/nsc/transform/UnCurry.scala b/src/compiler/scala/tools/nsc/transform/UnCurry.scala index d60ba017e3..bb552de8b9 100644 --- a/src/compiler/scala/tools/nsc/transform/UnCurry.scala +++ b/src/compiler/scala/tools/nsc/transform/UnCurry.scala @@ -484,8 +484,7 @@ abstract class UnCurry extends InfoTransform with TypingTransformers { val sym = tree.symbol // a local variable that is mutable and free somewhere later should be lifted // as lambda lifting (coming later) will wrap 'rhs' in an Ref object. - if (sym != NoSymbol && (!sym.owner.isSourceMethod || - (sym.isVariable && freeMutableVars(sym)))) + if (!sym.owner.isSourceMethod || (sym.isVariable && freeMutableVars(sym))) withNeedLift(true) { super.transform(tree) } else super.transform(tree) -- cgit v1.2.3