Skip to content

Removing unused code, take 2. #1648

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 19 commits into from
Nov 21, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 0 additions & 5 deletions src/compiler/scala/reflect/reify/Errors.scala
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@ trait Errors {
throw new ReificationException(defaultErrorPosition, msg)
}

def CannotReifySymbol(sym: Symbol) = {
val msg = "implementation restriction: cannot reify symbol %s (%s)".format(sym, sym.accurateKindString)
throw new ReificationException(defaultErrorPosition, msg)
}

def CannotReifyWeakType(details: Any) = {
val msg = "cannot create a TypeTag" + details + ": use WeakTypeTag instead"
throw new ReificationException(defaultErrorPosition, msg)
Expand Down
25 changes: 0 additions & 25 deletions src/compiler/scala/reflect/reify/codegen/GenUtils.scala
Original file line number Diff line number Diff line change
Expand Up @@ -90,22 +90,6 @@ trait GenUtils {
/** An (unreified) path that refers to term definition with given fully qualified name */
def termPath(fullname: String): Tree = path(fullname, newTermName)

/** An (unreified) path that refers to type definition with given fully qualified name */
def typePath(fullname: String): Tree = path(fullname, newTypeName)

def isTough(tpe: Type) = {
def isTough(tpe: Type) = tpe match {
case _: RefinedType => true
case _: ExistentialType => true
case _: ClassInfoType => true
case _: MethodType => true
case _: PolyType => true
case _ => false
}

tpe != null && (tpe exists isTough)
}

object TypedOrAnnotated {
def unapply(tree: Tree): Option[Tree] = tree match {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this intentional or just an oversight?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Is that a donkey or a baseball?"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:-)

case ty @ Typed(_, _) =>
Expand All @@ -117,15 +101,6 @@ trait GenUtils {
}
}

def isAnnotated(tpe: Type) = {
def isAnnotated(tpe: Type) = tpe match {
case _: AnnotatedType => true
case _ => false
}

tpe != null && (tpe exists isAnnotated)
}

def isSemiConcreteTypeMember(tpe: Type) = tpe match {
case TypeRef(SingleType(_, _), sym, _) if sym.isAbstractType && !sym.isExistential => true
case _ => false
Expand Down
4 changes: 3 additions & 1 deletion src/compiler/scala/reflect/reify/phases/Metalevels.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package scala.reflect.reify
package phases

import scala.collection.{ mutable }

trait Metalevels {
self: Reifier =>

Expand Down Expand Up @@ -101,7 +103,7 @@ trait Metalevels {
*/
val metalevels = new Transformer {
var insideSplice = false
var inlineableBindings = scala.collection.mutable.Map[TermName, Tree]()
val inlineableBindings = mutable.Map[TermName, Tree]()

def withinSplice[T](op: => T) = {
val old = insideSplice
Expand Down
3 changes: 0 additions & 3 deletions src/compiler/scala/reflect/reify/utils/SymbolTables.scala
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ trait SymbolTables {
private[SymbolTable] val original: Option[List[Tree]] = None) {

def syms: List[Symbol] = symtab.keys.toList
def isConcrete: Boolean = symtab.values forall (sym => !FreeTypeDef.unapply(sym).isDefined)

// def aliases: Map[Symbol, List[TermName]] = aliases.distinct groupBy (_._1) mapValues (_ map (_._2))

def symDef(sym: Symbol): Tree =
symtab.getOrElse(sym, EmptyTree)
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/scala/tools/ant/sabbus/Settings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ package scala.tools.ant.sabbus

import java.io.File

import org.apache.tools.ant.types.{Path, Reference}
import org.apache.tools.ant.types.Path

class Settings {

Expand Down
9 changes: 1 addition & 8 deletions src/compiler/scala/tools/cmd/FromString.scala
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,11 @@ abstract class FromString[+T](implicit t: ru.TypeTag[T]) extends PartialFunction
}

object FromString {
// We need these because we clash with the String => Path implicits.
private def toFile(s: String) = new File(new java.io.File(s))
// We need this because we clash with the String => Path implicits.
private def toDir(s: String) = new Directory(new java.io.File(s))

/** Path related stringifiers.
*/
val ExistingFile: FromString[File] = new FromString[File]()(tagOfFile) {
override def isDefinedAt(s: String) = toFile(s).isFile
def apply(s: String): File =
if (isDefinedAt(s)) toFile(s)
else cmd.runAndExit(println("'%s' is not an existing file." format s))
}
val ExistingDir: FromString[Directory] = new FromString[Directory]()(tagOfDirectory) {
override def isDefinedAt(s: String) = toDir(s).isDirectory
def apply(s: String): Directory =
Expand Down
1 change: 0 additions & 1 deletion src/compiler/scala/tools/cmd/Reference.scala
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ trait Reference extends Spec {
def isUnaryOption(s: String) = unary contains toOpt(s)
def isBinaryOption(s: String) = binary contains toOpt(s)
def isExpandOption(s: String) = expansionMap contains toOpt(s)
def isAnyOption(s: String) = isUnaryOption(s) || isBinaryOption(s) || isExpandOption(s)

def expandArg(arg: String) = expansionMap.getOrElse(fromOpt(arg), List(arg))

Expand Down
25 changes: 1 addition & 24 deletions src/compiler/scala/tools/nsc/CompilationUnits.scala
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ trait CompilationUnits { self: Global =>
class CompilationUnit(val source: SourceFile) extends CompilationUnitContextApi {

/** the fresh name creator */
var fresh: FreshNameCreator = new FreshNameCreator.Default
val fresh: FreshNameCreator = new FreshNameCreator.Default

def freshTermName(prefix: String): TermName = newTermName(fresh.newName(prefix))
def freshTypeName(prefix: String): TypeName = newTypeName(fresh.newName(prefix))
Expand All @@ -36,16 +36,6 @@ trait CompilationUnits { self: Global =>

def exists = source != NoSourceFile && source != null

// def parseSettings() = {
// val argsmarker = "SCALAC_ARGS"
// if(comments nonEmpty) {
// val pragmas = comments find (_.text.startsWith("//#")) // only parse first one
// pragmas foreach { p =>
// val i = p.text.indexOf(argsmarker)
// if(i > 0)
// }
// }
// }
/** Note: depends now contains toplevel classes.
* To get their sourcefiles, you need to dereference with .sourcefile
*/
Expand Down Expand Up @@ -107,18 +97,5 @@ trait CompilationUnits { self: Global =>
lazy val isJava = source.file.name.endsWith(".java")

override def toString() = source.toString()

def clear() {
fresh = new FreshNameCreator.Default
body = EmptyTree
depends.clear()
defined.clear()
synthetics.clear()
toCheck.clear()
checkedFeatures = Set()
icode.clear()
}
}
}


2 changes: 0 additions & 2 deletions src/compiler/scala/tools/nsc/CompileServer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ class StandardCompileServer extends SocketServer {
var shutdown = false
var verbose = false

val versionMsg = "Fast " + Properties.versionMsg

val MaxCharge = 0.8

private val runtime = Runtime.getRuntime()
Expand Down
5 changes: 0 additions & 5 deletions src/compiler/scala/tools/nsc/CompilerCommand.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ class CompilerCommand(arguments: List[String], val settings: Settings) {

type Setting = Settings#Setting

/** file extensions of files that the compiler can process */
lazy val fileEndings = Properties.fileEndings

private val processArgumentsResult =
if (shouldProcessArguments) processArguments
else (true, Nil)
Expand All @@ -40,8 +37,6 @@ class CompilerCommand(arguments: List[String], val settings: Settings) {
""".stripMargin.trim + "\n"

def shortUsage = "Usage: %s <options> <source files>" format cmdName
def createUsagePreface(shouldExplain: Boolean) =
if (shouldExplain) shortUsage + "\n" + explainAdvanced else ""

/** Creates a help message for a subset of options based on cond */
def createUsageMsg(cond: Setting => Boolean): String = {
Expand Down
21 changes: 0 additions & 21 deletions src/compiler/scala/tools/nsc/CompilerRun.scala

This file was deleted.

Loading