1
0

diplomacy: add reflection for parent modules to nodes

This commit is contained in:
Wesley W. Terpstra
2017-10-19 18:51:00 -07:00
parent c4978712c9
commit 7453186b59
2 changed files with 9 additions and 0 deletions

View File

@ -17,6 +17,11 @@ abstract class LazyModule()(implicit val p: Parameters)
protected[diplomacy] var info: SourceInfo = UnlocatableSourceInfo
protected[diplomacy] val parent = LazyModule.scope
def parents: Seq[LazyModule] = parent match {
case None => Nil
case Some(x) => x +: x.parents
}
LazyModule.scope = Some(this)
parent.foreach(p => p.children = this :: p.children)