diff options
| author | Chick Markley | 2016-10-11 15:53:40 -0700 |
|---|---|---|
| committer | Adam Izraelevitz | 2016-10-11 15:53:40 -0700 |
| commit | 2848d87721df110d0425114283cb5fa7e6c2ee03 (patch) | |
| tree | d76dd381fb77d63b8509a69063ace380f3209f33 /src/main/scala/firrtl/passes/CheckChirrtl.scala | |
| parent | 515f29f5993abb399db43b04e9a63c0fdf347ecc (diff) | |
Scala style cleanup take 5 (#324)
* working through variable shrouding
* working through variable shrouding
* working through variable shadowing
* working through variable shadowing
hmm there are some very fragile match {} in Passes
* working through variable shadowing
hmm there are some very fragile match {} in Passes
* working through variable shadowing
* working through variable shadowing
* working through variable shadowing
* working through variable shadowing
* working through variable shadowing
* working through variable shadowing
* working through variable shadowing
* working through variable shadowing
* Fixes suggested by Adam
Diffstat (limited to 'src/main/scala/firrtl/passes/CheckChirrtl.scala')
| -rw-r--r-- | src/main/scala/firrtl/passes/CheckChirrtl.scala | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/main/scala/firrtl/passes/CheckChirrtl.scala b/src/main/scala/firrtl/passes/CheckChirrtl.scala index 36285bf1..17e228eb 100644 --- a/src/main/scala/firrtl/passes/CheckChirrtl.scala +++ b/src/main/scala/firrtl/passes/CheckChirrtl.scala @@ -97,10 +97,10 @@ object CheckChirrtl extends Pass { def checkChirrtlE(info: Info, mname: String, names: NameSet)(e: Expression): Expression = { e match { case _: DoPrim | _:Mux | _:ValidIf | _: UIntLiteral => - case e: Reference if !names(e.name) => - errors append new UndeclaredReferenceException(info, mname, e.name) - case e: SubAccess => validSubexp(info, mname)(e.expr) - case e => e map validSubexp(info, mname) + case ex: Reference if !names(ex.name) => + errors append new UndeclaredReferenceException(info, mname, ex.name) + case ex: SubAccess => validSubexp(info, mname)(ex.expr) + case ex => ex map validSubexp(info, mname) } (e map checkChirrtlW(info, mname) map checkChirrtlT(info, mname) @@ -117,13 +117,13 @@ object CheckChirrtl extends Pass { def checkChirrtlS(minfo: Info, mname: String, names: NameSet)(s: Statement): Statement = { val info = get_info(s) match {case NoInfo => minfo case x => x} s map checkName(info, mname, names) match { - case s: DefMemory => - if (hasFlip(s.dataType)) errors append new MemWithFlipException(info, mname, s.name) - if (s.depth <= 0) errors append new NegMemSizeException(info, mname) - case s: DefInstance if !moduleNames(s.module) => - errors append new ModuleNotDefinedException(info, mname, s.module) - case s: Connect => checkValidLoc(info, mname, s.loc) - case s: PartialConnect => checkValidLoc(info, mname, s.loc) + case sx: DefMemory => + if (hasFlip(sx.dataType)) errors append new MemWithFlipException(info, mname, sx.name) + if (sx.depth <= 0) errors append new NegMemSizeException(info, mname) + case sx: DefInstance if !moduleNames(sx.module) => + errors append new ModuleNotDefinedException(info, mname, sx.module) + case sx: Connect => checkValidLoc(info, mname, sx.loc) + case sx: PartialConnect => checkValidLoc(info, mname, sx.loc) case _ => // Do Nothing } (s map checkChirrtlT(info, mname) |
