diff options
| author | chick | 2016-09-23 16:40:08 -0700 |
|---|---|---|
| committer | Donggyu Kim | 2016-09-25 14:39:44 -0700 |
| commit | 1f168585c80d5c96e41353d6275d99b34b967b23 (patch) | |
| tree | 44eee3d8e94cf41e2bd5094cff99ed58441cc7f4 /src/main/scala/firrtl/passes/ConstProp.scala | |
| parent | 16286528ad957a7d62a9c1b18bd6335a3102ea5b (diff) | |
remove unnecessary blocks
example 1 s"${x}"
example 2 case blah => { ??? }
Diffstat (limited to 'src/main/scala/firrtl/passes/ConstProp.scala')
| -rw-r--r-- | src/main/scala/firrtl/passes/ConstProp.scala | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/main/scala/firrtl/passes/ConstProp.scala b/src/main/scala/firrtl/passes/ConstProp.scala index 77ca161f..a95d3de0 100644 --- a/src/main/scala/firrtl/passes/ConstProp.scala +++ b/src/main/scala/firrtl/passes/ConstProp.scala @@ -176,7 +176,7 @@ object ConstProp extends Pass { } // Calculates an expression's range of values x match { - case e: DoPrim => { + case e: DoPrim => def r0 = range(e.args.head) def r1 = range(e.args(1)) e.op match { @@ -192,7 +192,6 @@ object ConstProp extends Pass { case Geq if (r0 < r1) => zero case _ => e } - } case e => e } } @@ -230,12 +229,11 @@ object ConstProp extends Pass { case _ => e } case Bits => e.args.head match { - case lit: Literal => { + case lit: Literal => val hi = e.consts.head.toInt val lo = e.consts(1).toInt require(hi >= lo) UIntLiteral((lit.value >> lo) & ((BigInt(1) << (hi - lo + 1)) - 1), getWidth(e.tpe)) - } case x if bitWidth(e.tpe) == bitWidth(x.tpe) => x.tpe match { case t: UIntType => x case _ => asUInt(x, e.tpe) |
