From 5fdd0b5a96a589b50e15fb8c3e7045bc32ceb21f Mon Sep 17 00:00:00 2001 From: Schuyler Eldridge Date: Thu, 27 Sep 2018 13:10:59 -0400 Subject: Make some Uniquify methods private [firrtl] This makes findValidPrefix and enumerateNames both private to FIRRTL (previously, these were private). This enables their use for name generation by other FIRRTL passes/transforms. Signed-off-by: Schuyler Eldridge --- src/main/scala/firrtl/passes/Uniquify.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/main/scala/firrtl/passes/Uniquify.scala b/src/main/scala/firrtl/passes/Uniquify.scala index 79954254..10d4e97f 100644 --- a/src/main/scala/firrtl/passes/Uniquify.scala +++ b/src/main/scala/firrtl/passes/Uniquify.scala @@ -45,7 +45,7 @@ object Uniquify extends Transform { // We don't add an _ in the collision check because elts could be Seq("") // In this case, we're just really checking if prefix itself collides @tailrec - private def findValidPrefix( + private [firrtl] def findValidPrefix( prefix: String, elts: Seq[String], namespace: collection.mutable.HashSet[String]): String = { @@ -59,7 +59,7 @@ object Uniquify extends Transform { // eg. foo : { bar : { a, b }[2], c } // => foo, foo bar, foo bar 0, foo bar 1, foo bar 0 a, foo bar 0 b, // foo bar 1 a, foo bar 1 b, foo c - private def enumerateNames(tpe: Type): Seq[Seq[String]] = tpe match { + private [firrtl] def enumerateNames(tpe: Type): Seq[Seq[String]] = tpe match { case t: BundleType => t.fields flatMap { f => (enumerateNames(f.tpe) map (f.name +: _)) ++ Seq(Seq(f.name)) -- cgit v1.2.3