aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools
diff options
context:
space:
mode:
authorDmitry Petrashko <dmitry.petrashko@gmail.com>2015-05-03 19:37:43 +0200
committerDmitry Petrashko <dmitry.petrashko@gmail.com>2015-05-08 13:33:51 +0200
commit66899f85cdeedf823da3f45c2ef0a55ccd6c3d99 (patch)
tree64bb4d9c5ff46cd31ed733c0bbbe09b41991e206 /src/dotty/tools
parent2350f4d5db9fc20acedf784bc57fac33a6b27805 (diff)
downloaddotty-66899f85cdeedf823da3f45c2ef0a55ccd6c3d99.tar.gz
dotty-66899f85cdeedf823da3f45c2ef0a55ccd6c3d99.tar.bz2
dotty-66899f85cdeedf823da3f45c2ef0a55ccd6c3d99.zip
Do not use deprecated procedure syntax in GenBCode.
Diffstat (limited to 'src/dotty/tools')
-rw-r--r--src/dotty/tools/backend/jvm/DottyBackendInterface.scala17
-rw-r--r--src/dotty/tools/backend/jvm/GenBCode.scala20
2 files changed, 21 insertions, 16 deletions
diff --git a/src/dotty/tools/backend/jvm/DottyBackendInterface.scala b/src/dotty/tools/backend/jvm/DottyBackendInterface.scala
index ef293db65..1f70e1bd3 100644
--- a/src/dotty/tools/backend/jvm/DottyBackendInterface.scala
+++ b/src/dotty/tools/backend/jvm/DottyBackendInterface.scala
@@ -230,7 +230,7 @@ class DottyBackendInterface()(implicit ctx: Context) extends BackendInterface{
private def emitArgument(av: AnnotationVisitor,
name: String,
- arg: Tree, bcodeStore: BCodeHelpers)(innerClasesStore: bcodeStore.BCInnerClassGen) {
+ arg: Tree, bcodeStore: BCodeHelpers)(innerClasesStore: bcodeStore.BCInnerClassGen): Unit = {
(arg: @unchecked) match {
case Literal(const @ Constant(_)) =>
@@ -296,7 +296,8 @@ class DottyBackendInterface()(implicit ctx: Context) extends BackendInterface{
}
}
- override def emitAnnotations(cw: asm.ClassVisitor, annotations: List[Annotation], bcodeStore: BCodeHelpers)(innerClasesStore: bcodeStore.BCInnerClassGen) {
+ override def emitAnnotations(cw: asm.ClassVisitor, annotations: List[Annotation], bcodeStore: BCodeHelpers)
+ (innerClasesStore: bcodeStore.BCInnerClassGen) = {
for(annot <- annotations; if shouldEmitAnnotation(annot)) {
val typ = annot.atp
val assocs = annot.assocs
@@ -305,14 +306,16 @@ class DottyBackendInterface()(implicit ctx: Context) extends BackendInterface{
}
}
- private def emitAssocs(av: asm.AnnotationVisitor, assocs: List[(Name, Object)], bcodeStore: BCodeHelpers)(innerClasesStore: bcodeStore.BCInnerClassGen) {
+ private def emitAssocs(av: asm.AnnotationVisitor, assocs: List[(Name, Object)], bcodeStore: BCodeHelpers)
+ (innerClasesStore: bcodeStore.BCInnerClassGen) = {
for ((name, value) <- assocs) {
emitArgument(av, name.toString(), value.asInstanceOf[Tree], bcodeStore)(innerClasesStore)
}
av.visitEnd()
}
- override def emitAnnotations(mw: asm.MethodVisitor, annotations: List[Annotation], bcodeStore: BCodeHelpers)(innerClasesStore: bcodeStore.BCInnerClassGen) {
+ override def emitAnnotations(mw: asm.MethodVisitor, annotations: List[Annotation], bcodeStore: BCodeHelpers)
+ (innerClasesStore: bcodeStore.BCInnerClassGen) = {
for(annot <- annotations; if shouldEmitAnnotation(annot)) {
val typ = annot.atp
val assocs = annot.assocs
@@ -321,7 +324,8 @@ class DottyBackendInterface()(implicit ctx: Context) extends BackendInterface{
}
}
- override def emitAnnotations(fw: asm.FieldVisitor, annotations: List[Annotation], bcodeStore: BCodeHelpers)(innerClasesStore: bcodeStore.BCInnerClassGen) {
+ override def emitAnnotations(fw: asm.FieldVisitor, annotations: List[Annotation], bcodeStore: BCodeHelpers)
+ (innerClasesStore: bcodeStore.BCInnerClassGen) = {
for(annot <- annotations; if shouldEmitAnnotation(annot)) {
val typ = annot.atp
val assocs = annot.assocs
@@ -330,7 +334,8 @@ class DottyBackendInterface()(implicit ctx: Context) extends BackendInterface{
}
}
- override def emitParamAnnotations(jmethod: asm.MethodVisitor, pannotss: List[List[Annotation]], bcodeStore: BCodeHelpers)(innerClasesStore: bcodeStore.BCInnerClassGen) {
+ override def emitParamAnnotations(jmethod: asm.MethodVisitor, pannotss: List[List[Annotation]], bcodeStore: BCodeHelpers)
+ (innerClasesStore: bcodeStore.BCInnerClassGen): Unit = {
val annotationss = pannotss map (_ filter shouldEmitAnnotation)
if (annotationss forall (_.isEmpty)) return
for ((annots, idx) <- annotationss.zipWithIndex;
diff --git a/src/dotty/tools/backend/jvm/GenBCode.scala b/src/dotty/tools/backend/jvm/GenBCode.scala
index 221843881..d7557acec 100644
--- a/src/dotty/tools/backend/jvm/GenBCode.scala
+++ b/src/dotty/tools/backend/jvm/GenBCode.scala
@@ -116,7 +116,7 @@ class GenBCodePipeline(val entryPoints: List[Symbol], val int: DottyBackendInter
val caseInsensitively = scala.collection.mutable.Map.empty[String, Symbol]
- def run() {
+ def run(): Unit = {
while (true) {
val item = q1.poll
if (item.isPoison) {
@@ -140,7 +140,7 @@ class GenBCodePipeline(val entryPoints: List[Symbol], val int: DottyBackendInter
* enqueues them in queue-2.
*
*/
- def visit(item: Item1) {
+ def visit(item: Item1) = {
val Item1(arrivalPos, cd, cunit) = item
val claszSymbol = cd.symbol
@@ -218,7 +218,7 @@ class GenBCodePipeline(val entryPoints: List[Symbol], val int: DottyBackendInter
/*BackendStats.timed(BackendStats.methodOptTimer)*/(localOpt.methodOptimizations(classNode))
}
- def run() {
+ def run(): Unit = {
while (true) {
val item = q2.poll
if (item.isPoison) {
@@ -238,7 +238,7 @@ class GenBCodePipeline(val entryPoints: List[Symbol], val int: DottyBackendInter
}
}
- private def addToQ3(item: Item2) {
+ private def addToQ3(item: Item2) = {
def getByteArray(cn: asm.tree.ClassNode): Array[Byte] = {
val cw = new CClassWriter(extraProc)
@@ -277,7 +277,7 @@ class GenBCodePipeline(val entryPoints: List[Symbol], val int: DottyBackendInter
* (c) tear down (closing the classfile-writer and clearing maps)
*
*/
- def run(t: Tree) {
+ def run(t: Tree) = {
this.tree = t
// val bcodeStart = Statistics.startTimer(BackendStats.bcodeTimer)
@@ -321,7 +321,7 @@ class GenBCodePipeline(val entryPoints: List[Symbol], val int: DottyBackendInter
* (c) dequeue one at a time from queue-2, convert it to byte-array, place in queue-3
* (d) serialize to disk by draining queue-3.
*/
- private def buildAndSendToDisk(needsOutFolder: Boolean) {
+ private def buildAndSendToDisk(needsOutFolder: Boolean) = {
feedPipeline1()
// val genStart = Statistics.startTimer(BackendStats.bcodeGenStat)
@@ -337,8 +337,8 @@ class GenBCodePipeline(val entryPoints: List[Symbol], val int: DottyBackendInter
}
/* Feed pipeline-1: place all ClassDefs on q1, recording their arrival position. */
- private def feedPipeline1() {
- def gen(tree: Tree) {
+ private def feedPipeline1() = {
+ def gen(tree: Tree): Unit = {
tree match {
case EmptyTree => ()
case PackageDef(_, stats) => stats foreach gen
@@ -353,9 +353,9 @@ class GenBCodePipeline(val entryPoints: List[Symbol], val int: DottyBackendInter
}
/* Pipeline that writes classfile representations to disk. */
- private def drainQ3() {
+ private def drainQ3() = {
- def sendToDisk(cfr: SubItem3, outFolder: scala.tools.nsc.io.AbstractFile) {
+ def sendToDisk(cfr: SubItem3, outFolder: scala.tools.nsc.io.AbstractFile): Unit = {
if (cfr != null){
val SubItem3(jclassName, jclassBytes) = cfr
try {