aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSchuyler Eldridge2018-09-27 12:41:09 -0400
committerSchuyler Eldridge2018-10-03 14:47:54 -0400
commite98f8efcc4feb1c7a630bd2657f1a902216e6c40 (patch)
tree0bc038f43513634cc6146102474ba182601b39d4 /src
parent16f3dbda5c3868419cf78d4d83133cd34adf3303 (diff)
Add cloneUnderlying method to Namespace
This adds a method, cloneUnderlying, to Namespace that returns a copy of the underlying mutable.HashSet. This is useful for constructing a Namespace that you would like to manipulate manually without using Namespace's methods to generate temporaries. Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com>
Diffstat (limited to 'src')
-rw-r--r--src/main/scala/firrtl/Namespace.scala5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main/scala/firrtl/Namespace.scala b/src/main/scala/firrtl/Namespace.scala
index f40748c2..cc5d8967 100644
--- a/src/main/scala/firrtl/Namespace.scala
+++ b/src/main/scala/firrtl/Namespace.scala
@@ -39,6 +39,11 @@ class Namespace private {
}
def newTemp: String = newName(tempNamePrefix)
+
+ /** Create a copy of the [[scala.collection.mutable.HashSet HashSet]] backing this [[Namespace]]
+ * @return a copy of the underlying [[scala.collection.mutable.HashSet HashSet]]
+ */
+ def cloneUnderlying: mutable.HashSet[String] = namespace.clone
}
/* TODO(azidar): Make Namespace return unique names that will not conflict with expanded