Add support for singletons to walk module deps.

Change-Id: I63405ee917a55ae92cf55070af94e01ddc266389
This commit is contained in:
Jamie Gennis 2014-06-17 10:24:24 -07:00
parent 48aed8cee0
commit e98b8a927d

View file

@ -32,6 +32,9 @@ type SingletonContext interface {
VisitAllModules(visit func(Module))
VisitAllModulesIf(pred func(Module) bool, visit func(Module))
VisitDepsDepthFirst(module Module, visit func(Module))
VisitDepsDepthFirstIf(module Module, pred func(Module) bool,
visit func(Module))
}
var _ SingletonContext = (*singletonContext)(nil)
@ -133,3 +136,15 @@ func (s *singletonContext) VisitAllModulesIf(pred func(Module) bool,
s.context.visitAllModulesIf(pred, visit)
}
func (s *singletonContext) VisitDepsDepthFirst(module Module,
visit func(Module)) {
s.context.visitDepsDepthFirst(module, visit)
}
func (s *singletonContext) VisitDepsDepthFirstIf(module Module,
pred func(Module) bool, visit func(Module)) {
s.context.visitDepsDepthFirstIf(module, pred, visit)
}