diff options
author | michelou <michelou@epfl.ch> | 2008-07-15 10:07:02 +0000 |
---|---|---|
committer | michelou <michelou@epfl.ch> | 2008-07-15 10:07:02 +0000 |
commit | 45a3c3aeeffb2f0e932b1edc8c5af739ff2b1d3c (patch) | |
tree | 16faa36f5c96ccf293933164e068e8a1cc3f3b60 /src/compiler | |
parent | 7ec37d609c1ad607d9af18a245b9c6e6e8019f70 (diff) | |
download | scala-45a3c3aeeffb2f0e932b1edc8c5af739ff2b1d3c.tar.gz scala-45a3c3aeeffb2f0e932b1edc8c5af739ff2b1d3c.tar.bz2 scala-45a3c3aeeffb2f0e932b1edc8c5af739ff2b1d3c.zip |
cosmetic changes (Unit)
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/tools/nsc/backend/icode/BasicBlocks.scala | 25 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/backend/icode/GenICode.scala | 2 |
2 files changed, 14 insertions, 13 deletions
diff --git a/src/compiler/scala/tools/nsc/backend/icode/BasicBlocks.scala b/src/compiler/scala/tools/nsc/backend/icode/BasicBlocks.scala index 07a2142f8b..b50bb8aebc 100644 --- a/src/compiler/scala/tools/nsc/backend/icode/BasicBlocks.scala +++ b/src/compiler/scala/tools/nsc/backend/icode/BasicBlocks.scala @@ -267,7 +267,7 @@ trait BasicBlocks { /** Remove the last instruction of this basic block. It is * fast for an open block, but slower when the block is closed. */ - def removeLastInstruction: Unit = { + def removeLastInstruction { if (closed) removeInstructionsAt(size) else { @@ -280,7 +280,7 @@ trait BasicBlocks { * * @param map ... */ - def subst(map: Map[Instruction, Instruction]): Unit = + def subst(map: Map[Instruction, Instruction]) { if (!closed) substOnList(map) else { var i = 0 while (i < instrs.length) { @@ -288,9 +288,10 @@ trait BasicBlocks { case Some(instr) => touched = replaceInstruction(i, instr) case None => () } - i = i + 1 + i += 1 } } + } private def substOnList(map: Map[Instruction, Instruction]) { def subst(l: List[Instruction]): List[Instruction] = l match { @@ -311,18 +312,19 @@ trait BasicBlocks { /** Add a new instruction at the end of the block, * using the same source position as the last emitted instruction */ - def emit(instr: Instruction): Unit = + def emit(instr: Instruction) { if (!instructionList.isEmpty) emit(instr, instructionList.head.pos) else emit(instr, NoPosition) + } - def emit(instr: Instruction, pos: Position) = { + def emit(instr: Instruction, pos: Position) { if (closed) { print() Console.println("trying to emit: " + instr) } - assert (!closed || ignore, "BasicBlock closed") + assert(!closed || ignore, "BasicBlock closed") if (!ignore) { touched = true @@ -337,22 +339,21 @@ trait BasicBlocks { } /** Close the block */ - def close = { - assert(instructionList.length > 0, - "Empty block.") + def close { + assert(instructionList.length > 0, "Empty block.") closed = true instructionList = instructionList.reverse instrs = toInstructionArray(instructionList) } - def open = { + def open { assert(closed) closed = false ignore = false instructionList = instructionList.reverse // prepare for appending to the head } - def clear: Unit = { + def clear { instructionList = Nil instrs = null preds = null @@ -366,7 +367,7 @@ trait BasicBlocks { */ def enterIgnoreMode = ignore = true - def exitIgnoreMode = { + def exitIgnoreMode { assert(ignore, "Exit ignore mode when not in ignore mode.") ignore = false } diff --git a/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala b/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala index 32dcf06365..dcbbb6b659 100644 --- a/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala +++ b/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala @@ -1031,7 +1031,7 @@ abstract class GenICode extends SubComponent { case _ => if (settings.debug.value) assert(from != UNIT, "Can't convert from UNIT to " + to + - tree + " at: " + (tree.pos)); + tree + " at: " + (tree.pos)) assert(!from.isReferenceType && !to.isReferenceType, "type error: can't convert from " + from + " to " + to +" in unit "+this.unit) ctx.bb.emit(CALL_PRIMITIVE(Conversion(from, to)), tree.pos); } |