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
* Modify for backporting
  • Loading branch information
albert-magyar committed May 14, 2020
1 parent 677dc57 commit e77598e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/main/scala/firrtl/passes/ResolveKinds.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@ package firrtl.passes
import firrtl._
import firrtl.ir._
import firrtl.Mappers._
import firrtl.traversals.Foreachers._
import firrtl.options.PreservesAll

object ResolveKinds extends Pass {
private def find_port(kinds: collection.mutable.HashMap[String, Kind])(p: Port): Port = {
kinds(p.name) = PortKind ; p

private def find_port(kinds: collection.mutable.HashMap[String, Kind])(p: Port): Unit = {
kinds(p.name) = PortKind
}

def resolve_expr(kinds: collection.mutable.HashMap[String, Kind])(e: Expression): Expression = e match {
Expand All @@ -31,7 +34,7 @@ object ResolveKinds extends Pass {

def resolve_kinds(m: DefModule): DefModule = {
val kinds = new collection.mutable.HashMap[String, Kind]
m.map(find_port(kinds))
m.foreach(find_port(kinds))
m.map(resolve_stmt(kinds))
}

Expand Down

0 comments on commit e77598e

Please sign in to comment.