summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/util
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-02-14 00:21:12 +0000
committerPaul Phillips <paulp@improving.org>2011-02-14 00:21:12 +0000
commitc7f0ca2897836271030cf3be0fa3c6892ea89969 (patch)
treea73398f4044b9939a8dcd43a90a48720eb005fe2 /src/compiler/scala/tools/util
parent4ddfe877b26a8a5dea6b71b50481cdfe88cf72c3 (diff)
downloadscala-c7f0ca2897836271030cf3be0fa3c6892ea89969.tar.gz
scala-c7f0ca2897836271030cf3be0fa3c6892ea89969.tar.bz2
scala-c7f0ca2897836271030cf3be0fa3c6892ea89969.zip
Added new setting -Ygen-javap, which takes a di...
Added new setting -Ygen-javap, which takes a directory as an argument and generates javap output for every generated classfile. There is still a lot of noise in a diff: still todo is postprocessing the output to remove diff-noise-generating numbers and such. No review.
Diffstat (limited to 'src/compiler/scala/tools/util')
-rw-r--r--src/compiler/scala/tools/util/Javap.scala5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/util/Javap.scala b/src/compiler/scala/tools/util/Javap.scala
index 48971d6de0..bda8ffbd1b 100644
--- a/src/compiler/scala/tools/util/Javap.scala
+++ b/src/compiler/scala/tools/util/Javap.scala
@@ -20,9 +20,12 @@ class Javap(
lazy val parser = new JpOptions
+ def findBytes(path: String): Array[Byte] =
+ tryFile(path) getOrElse tryClass(path)
+
def apply(args: Seq[String]): List[JpResult] = {
args.toList filterNot (_ startsWith "-") map { path =>
- val bytes = tryFile(path) getOrElse tryClass(path)
+ val bytes = findBytes(path)
if (bytes.isEmpty) new JpError("Could not find class bytes for '%s'".format(path))
else new JpSuccess(newPrinter(new ByteArrayInputStream(bytes), newEnv(args)))
}