Skip to content
This repository has been archived by the owner on Aug 20, 2024. It is now read-only.

Commit

Permalink
Make find_port return Unit and use Foreachers in ResolveKinds
Browse files Browse the repository at this point in the history
  • Loading branch information
albert-magyar committed May 14, 2020
1 parent 7f81175 commit 1705980
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/main/scala/firrtl/passes/ResolveKinds.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package firrtl.passes
import firrtl._
import firrtl.ir._
import firrtl.Mappers._
import firrtl.traversals.Foreachers._
import firrtl.options.PreservesAll

object ResolveKinds extends Pass with PreservesAll[Transform] {
Expand All @@ -13,8 +14,8 @@ object ResolveKinds extends Pass with PreservesAll[Transform] {

type KindMap = collection.mutable.HashMap[String, Kind]

def find_port(kinds: KindMap)(p: Port): Port = {
kinds(p.name) = PortKind ; p
private def find_port(kinds: KindMap)(p: Port): Unit = {
kinds(p.name) = PortKind
}

def resolve_expr(kinds: KindMap)(e: Expression): Expression = e match {
Expand All @@ -37,7 +38,7 @@ object ResolveKinds extends Pass with PreservesAll[Transform] {

def resolve_kinds(m: DefModule): DefModule = {
val kinds = new KindMap
m.map(find_port(kinds))
m.foreach(find_port(kinds))
m.map(resolve_stmt(kinds))
}

Expand Down

0 comments on commit 1705980

Please sign in to comment.