diff options
author | Josh Suereth <joshua.suereth@gmail.com> | 2011-12-05 15:02:57 -0500 |
---|---|---|
committer | Josh Suereth <joshua.suereth@gmail.com> | 2011-12-05 15:02:57 -0500 |
commit | 01fffafac5f8184fc6abc4268a2b2d1a2503d5ca (patch) | |
tree | 392182d9addf0311e1c4961eee4fb38b4185d4c0 /src | |
parent | c86928f1dc736605a182e20528192eaed91bea62 (diff) | |
parent | 09ba583b1e08b96d9b1d703a1c0c6bdaa55ae7f7 (diff) | |
download | scala-01fffafac5f8184fc6abc4268a2b2d1a2503d5ca.tar.gz scala-01fffafac5f8184fc6abc4268a2b2d1a2503d5ca.tar.bz2 scala-01fffafac5f8184fc6abc4268a2b2d1a2503d5ca.zip |
Merge branch 'master' into xsbt
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/ant/templates/tool-unix.tmpl | 22 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala | 14 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/transform/LiftCode.scala | 2 |
3 files changed, 31 insertions, 7 deletions
diff --git a/src/compiler/scala/tools/ant/templates/tool-unix.tmpl b/src/compiler/scala/tools/ant/templates/tool-unix.tmpl index 4275ef7ba1..7e51930fa4 100644 --- a/src/compiler/scala/tools/ant/templates/tool-unix.tmpl +++ b/src/compiler/scala/tools/ant/templates/tool-unix.tmpl @@ -58,12 +58,17 @@ if uname | grep -q ^CYGWIN; then cygwin="$(uname)" fi +unset mingw +if uname | grep -q ^MINGW; then + mingw="$(uname)" +fi + # Finding the root folder for this Scala distribution SCALA_HOME="$(findScalaHome)" SEP=":" # Possible additional command line options -CYGWIN_OPT="" +WINDOWS_OPT="" EMACS_OPT="" [[ -n "$EMACS" ]] && EMACS_OPT="-Denv.emacs=$EMACS" @@ -94,10 +99,16 @@ if [[ -n "$cygwin" ]]; then fi SCALA_HOME="$(cygpath --$format "$SCALA_HOME")" TOOL_CLASSPATH="$(cygpath --path --$format "$TOOL_CLASSPATH")" +elif [[ -n "$mingw" ]]; then + SCALA_HOME="$(cmd //c echo "$SCALA_HOME")" + TOOL_CLASSPATH="$(cmd //c echo "$TOOL_CLASSPATH")" +fi + +if [[ -n "$cygwin$mingw" ]]; then case "$TERM" in rxvt* | xterm*) stty -icanon min 1 -echo - CYGWIN_OPT="-Djline.terminal=scala.tools.jline.UnixTerminal" + WINDOWS_OPT="-Djline.terminal=scala.tools.jline.UnixTerminal" ;; esac fi @@ -110,9 +121,10 @@ fi declare -a java_args declare -a scala_args -# default to the boot classpath for speed, except on cygwin/mingw. +# default to the boot classpath for speed, except on cygwin/mingw because +# JLine on Windows requires a custom DLL to be loaded. unset usebootcp -if [[ -z $cygwin ]]; then +if [[ -z "$cygwin$mingw" ]]; then usebootcp="true" fi @@ -181,7 +193,7 @@ execCommand \ -Dscala.home="$SCALA_HOME" \ -Dscala.usejavacp=true \ $EMACS_OPT \ - $CYGWIN_OPT \ + $WINDOWS_OPT \ @properties@ @class@ @toolflags@ "$@@" # record the exit status lest it be overwritten: diff --git a/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala b/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala index 3fe5b83515..3fa5158a4a 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala @@ -308,6 +308,18 @@ abstract class GenJVM extends SubComponent with GenJVMUtil with GenAndroid with private var innerClassBuffer = mutable.LinkedHashSet[Symbol]() + /** Drop redundant interfaces (ones which are implemented by some + * other parent) from the immediate parents. This is important on + * android because there is otherwise an interface explosion. + */ + private def minimizeInterfaces(interfaces: List[Symbol]): List[Symbol] = ( + interfaces filterNot (int1 => + interfaces exists (int2 => + (int1 ne int2) && (int2 isSubClass int1) + ) + ) + ) + def genClass(c: IClass) { clasz = c innerClassBuffer.clear() @@ -322,7 +334,7 @@ abstract class GenJVM extends SubComponent with GenJVMUtil with GenAndroid with } val ifaces = superInterfaces match { case Nil => JClass.NO_INTERFACES - case _ => mkArray(superInterfaces map (x => javaName(x.typeSymbol))) + case _ => mkArray(minimizeInterfaces(superInterfaces map (_.typeSymbol)) map javaName) } jclass = fjbgContext.JClass(javaFlags(c.symbol), diff --git a/src/compiler/scala/tools/nsc/transform/LiftCode.scala b/src/compiler/scala/tools/nsc/transform/LiftCode.scala index 68a53e57a1..f3f823d197 100644 --- a/src/compiler/scala/tools/nsc/transform/LiftCode.scala +++ b/src/compiler/scala/tools/nsc/transform/LiftCode.scala @@ -95,7 +95,7 @@ abstract class LiftCode extends Transform with TypingTransformers { buf.append(", " + "List(" + annotations + ")") var s = buf.toString - if (s.endsWith(", Map()")) s = s.substring(0, s.length - ", Map()".length) + if (s.endsWith(", List()")) s = s.substring(0, s.length - ", List()".length) if (s.endsWith(", newTypeName(\"\")")) s = s.substring(0, s.length - ", newTypeName(\"\")".length) if (s.endsWith("Set()")) s = s.substring(0, s.length - "Set()".length) "Modifiers(" + s + ")" |