Skip to content

Commit

Permalink
Reorder to avoid code appearing like a forward reference.
Browse files Browse the repository at this point in the history
It isn't, because LOOP_HEADER and friends are compile time
constants. But I'd argue that its clearer not to rely on that here.
  • Loading branch information
retronym committed Feb 24, 2013
1 parent 8cdf3b3 commit 6e450ed
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/compiler/scala/tools/nsc/backend/icode/BasicBlocks.scala
Expand Up @@ -500,18 +500,6 @@ trait BasicBlocks {
}

object BBFlags {
val flagMap = Map[Int, String](
LOOP_HEADER -> "loopheader",
IGNORING -> "ignore",
EX_HEADER -> "exheader",
CLOSED -> "closed",
DIRTYSUCCS -> "dirtysuccs",
DIRTYPREDS -> "dirtypreds"
)
def flagsToString(flags: Int) = {
flagMap collect { case (bit, name) if (bit & flags) != 0 => "<" + name + ">" } mkString " "
}

/** This block is a loop header (was translated from a while). */
final val LOOP_HEADER = (1 << 0)

Expand All @@ -529,4 +517,16 @@ object BBFlags {

/** Code has been changed, recompute predecessors. */
final val DIRTYPREDS = (1 << 5)

val flagMap = Map[Int, String](
LOOP_HEADER -> "loopheader",
IGNORING -> "ignore",
EX_HEADER -> "exheader",
CLOSED -> "closed",
DIRTYSUCCS -> "dirtysuccs",
DIRTYPREDS -> "dirtypreds"
)
def flagsToString(flags: Int) = {
flagMap collect { case (bit, name) if (bit & flags) != 0 => "<" + name + ">" } mkString " "
}
}

0 comments on commit 6e450ed

Please sign in to comment.