Skip to content

Commit 6e281ff

Browse files
committed
Do not use deprecated procedure syntax in GenBCode.
1 parent 8f5f07f commit 6e281ff

File tree

2 files changed

+21
-16
lines changed

2 files changed

+21
-16
lines changed

src/dotty/tools/backend/jvm/DottyBackendInterface.scala

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ class DottyBackendInterface()(implicit ctx: Context) extends BackendInterface{
230230

231231
private def emitArgument(av: AnnotationVisitor,
232232
name: String,
233-
arg: Tree, bcodeStore: BCodeHelpers)(innerClasesStore: bcodeStore.BCInnerClassGen) {
233+
arg: Tree, bcodeStore: BCodeHelpers)(innerClasesStore: bcodeStore.BCInnerClassGen): Unit = {
234234
(arg: @unchecked) match {
235235

236236
case Literal(const @ Constant(_)) =>
@@ -296,7 +296,8 @@ class DottyBackendInterface()(implicit ctx: Context) extends BackendInterface{
296296
}
297297
}
298298

299-
override def emitAnnotations(cw: asm.ClassVisitor, annotations: List[Annotation], bcodeStore: BCodeHelpers)(innerClasesStore: bcodeStore.BCInnerClassGen) {
299+
override def emitAnnotations(cw: asm.ClassVisitor, annotations: List[Annotation], bcodeStore: BCodeHelpers)
300+
(innerClasesStore: bcodeStore.BCInnerClassGen) = {
300301
for(annot <- annotations; if shouldEmitAnnotation(annot)) {
301302
val typ = annot.atp
302303
val assocs = annot.assocs
@@ -305,14 +306,16 @@ class DottyBackendInterface()(implicit ctx: Context) extends BackendInterface{
305306
}
306307
}
307308

308-
private def emitAssocs(av: asm.AnnotationVisitor, assocs: List[(Name, Object)], bcodeStore: BCodeHelpers)(innerClasesStore: bcodeStore.BCInnerClassGen) {
309+
private def emitAssocs(av: asm.AnnotationVisitor, assocs: List[(Name, Object)], bcodeStore: BCodeHelpers)
310+
(innerClasesStore: bcodeStore.BCInnerClassGen) = {
309311
for ((name, value) <- assocs) {
310312
emitArgument(av, name.toString(), value.asInstanceOf[Tree], bcodeStore)(innerClasesStore)
311313
}
312314
av.visitEnd()
313315
}
314316

315-
override def emitAnnotations(mw: asm.MethodVisitor, annotations: List[Annotation], bcodeStore: BCodeHelpers)(innerClasesStore: bcodeStore.BCInnerClassGen) {
317+
override def emitAnnotations(mw: asm.MethodVisitor, annotations: List[Annotation], bcodeStore: BCodeHelpers)
318+
(innerClasesStore: bcodeStore.BCInnerClassGen) = {
316319
for(annot <- annotations; if shouldEmitAnnotation(annot)) {
317320
val typ = annot.atp
318321
val assocs = annot.assocs
@@ -321,7 +324,8 @@ class DottyBackendInterface()(implicit ctx: Context) extends BackendInterface{
321324
}
322325
}
323326

324-
override def emitAnnotations(fw: asm.FieldVisitor, annotations: List[Annotation], bcodeStore: BCodeHelpers)(innerClasesStore: bcodeStore.BCInnerClassGen) {
327+
override def emitAnnotations(fw: asm.FieldVisitor, annotations: List[Annotation], bcodeStore: BCodeHelpers)
328+
(innerClasesStore: bcodeStore.BCInnerClassGen) = {
325329
for(annot <- annotations; if shouldEmitAnnotation(annot)) {
326330
val typ = annot.atp
327331
val assocs = annot.assocs
@@ -330,7 +334,8 @@ class DottyBackendInterface()(implicit ctx: Context) extends BackendInterface{
330334
}
331335
}
332336

333-
override def emitParamAnnotations(jmethod: asm.MethodVisitor, pannotss: List[List[Annotation]], bcodeStore: BCodeHelpers)(innerClasesStore: bcodeStore.BCInnerClassGen) {
337+
override def emitParamAnnotations(jmethod: asm.MethodVisitor, pannotss: List[List[Annotation]], bcodeStore: BCodeHelpers)
338+
(innerClasesStore: bcodeStore.BCInnerClassGen): Unit = {
334339
val annotationss = pannotss map (_ filter shouldEmitAnnotation)
335340
if (annotationss forall (_.isEmpty)) return
336341
for ((annots, idx) <- annotationss.zipWithIndex;

src/dotty/tools/backend/jvm/GenBCode.scala

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ class GenBCodePipeline(val entryPoints: List[Symbol], val int: DottyBackendInter
116116

117117
val caseInsensitively = scala.collection.mutable.Map.empty[String, Symbol]
118118

119-
def run() {
119+
def run(): Unit = {
120120
while (true) {
121121
val item = q1.poll
122122
if (item.isPoison) {
@@ -140,7 +140,7 @@ class GenBCodePipeline(val entryPoints: List[Symbol], val int: DottyBackendInter
140140
* enqueues them in queue-2.
141141
*
142142
*/
143-
def visit(item: Item1) {
143+
def visit(item: Item1) = {
144144
val Item1(arrivalPos, cd, cunit) = item
145145
val claszSymbol = cd.symbol
146146

@@ -218,7 +218,7 @@ class GenBCodePipeline(val entryPoints: List[Symbol], val int: DottyBackendInter
218218
/*BackendStats.timed(BackendStats.methodOptTimer)*/(localOpt.methodOptimizations(classNode))
219219
}
220220

221-
def run() {
221+
def run(): Unit = {
222222
while (true) {
223223
val item = q2.poll
224224
if (item.isPoison) {
@@ -238,7 +238,7 @@ class GenBCodePipeline(val entryPoints: List[Symbol], val int: DottyBackendInter
238238
}
239239
}
240240

241-
private def addToQ3(item: Item2) {
241+
private def addToQ3(item: Item2) = {
242242

243243
def getByteArray(cn: asm.tree.ClassNode): Array[Byte] = {
244244
val cw = new CClassWriter(extraProc)
@@ -277,7 +277,7 @@ class GenBCodePipeline(val entryPoints: List[Symbol], val int: DottyBackendInter
277277
* (c) tear down (closing the classfile-writer and clearing maps)
278278
*
279279
*/
280-
def run(t: Tree) {
280+
def run(t: Tree) = {
281281
this.tree = t
282282

283283
// val bcodeStart = Statistics.startTimer(BackendStats.bcodeTimer)
@@ -321,7 +321,7 @@ class GenBCodePipeline(val entryPoints: List[Symbol], val int: DottyBackendInter
321321
* (c) dequeue one at a time from queue-2, convert it to byte-array, place in queue-3
322322
* (d) serialize to disk by draining queue-3.
323323
*/
324-
private def buildAndSendToDisk(needsOutFolder: Boolean) {
324+
private def buildAndSendToDisk(needsOutFolder: Boolean) = {
325325

326326
feedPipeline1()
327327
// val genStart = Statistics.startTimer(BackendStats.bcodeGenStat)
@@ -337,8 +337,8 @@ class GenBCodePipeline(val entryPoints: List[Symbol], val int: DottyBackendInter
337337
}
338338

339339
/* Feed pipeline-1: place all ClassDefs on q1, recording their arrival position. */
340-
private def feedPipeline1() {
341-
def gen(tree: Tree) {
340+
private def feedPipeline1() = {
341+
def gen(tree: Tree): Unit = {
342342
tree match {
343343
case EmptyTree => ()
344344
case PackageDef(_, stats) => stats foreach gen
@@ -353,9 +353,9 @@ class GenBCodePipeline(val entryPoints: List[Symbol], val int: DottyBackendInter
353353
}
354354

355355
/* Pipeline that writes classfile representations to disk. */
356-
private def drainQ3() {
356+
private def drainQ3() = {
357357

358-
def sendToDisk(cfr: SubItem3, outFolder: scala.tools.nsc.io.AbstractFile) {
358+
def sendToDisk(cfr: SubItem3, outFolder: scala.tools.nsc.io.AbstractFile): Unit = {
359359
if (cfr != null){
360360
val SubItem3(jclassName, jclassBytes) = cfr
361361
try {

0 commit comments

Comments
 (0)