Reverse order of tag and android module checks

Currently, this checks validates a module then checks the tag for all
modules. However, we don't need to validate modules where the tag does
not apply.

Test: m nothing and compare ninja/mk files
Change-Id: I6298c9dc8aa37ffac74202bea59f4090fff90e4e
This commit is contained in:
Liz Kammer 2022-01-24 16:17:30 -05:00
parent 539d41b686
commit 5514698bc8

View file

@ -2620,7 +2620,7 @@ func (b *baseModuleContext) validateAndroidModule(module blueprint.Module, tag b
}
if aModule == nil {
b.ModuleErrorf("module %q not an android module", b.OtherModuleName(module))
b.ModuleErrorf("module %q (%#v) not an android module", b.OtherModuleName(module), tag)
return nil
}
@ -2742,8 +2742,8 @@ func (b *baseModuleContext) VisitDirectDeps(visit func(Module)) {
func (b *baseModuleContext) VisitDirectDepsWithTag(tag blueprint.DependencyTag, visit func(Module)) {
b.bp.VisitDirectDeps(func(module blueprint.Module) {
if aModule := b.validateAndroidModule(module, b.bp.OtherModuleDependencyTag(module), b.strictVisitDeps); aModule != nil {
if b.bp.OtherModuleDependencyTag(aModule) == tag {
if b.bp.OtherModuleDependencyTag(module) == tag {
if aModule := b.validateAndroidModule(module, b.bp.OtherModuleDependencyTag(module), b.strictVisitDeps); aModule != nil {
visit(aModule)
}
}