Change CommonModuleInfoProvider to a pointer.
Bug: 358427516
Test: Manually verified genereated ninja and mk files, unit tests.
Change-Id: I53a6dd718232735decbeb93febfd269dd9449e86
diff --git a/cc/cc.go b/cc/cc.go
index ae6f3b0..85d2ebf 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -3422,7 +3422,7 @@
return
}
- commonInfo := android.OtherModuleProviderOrDefault(ctx, dep, android.CommonModuleInfoProvider)
+ commonInfo := android.OtherModulePointerProviderOrDefault(ctx, dep, android.CommonModuleInfoProvider)
if commonInfo.Target.Os != ctx.Os() {
ctx.ModuleErrorf("OS mismatch between %q (%s) and %q (%s)", ctx.ModuleName(), ctx.Os().Name, depName, dep.Target().Os.Name)
return
@@ -3676,7 +3676,7 @@
c.sabi.Properties.ReexportedSystemIncludes, depExporterInfo.SystemIncludeDirs.Strings()...)
}
- makeLibName := MakeLibName(ccInfo, linkableInfo, &commonInfo, commonInfo.BaseModuleName) + libDepTag.makeSuffix
+ makeLibName := MakeLibName(ccInfo, linkableInfo, commonInfo, commonInfo.BaseModuleName) + libDepTag.makeSuffix
switch {
case libDepTag.header():
c.Properties.AndroidMkHeaderLibs = append(
@@ -3703,7 +3703,7 @@
switch depTag {
case runtimeDepTag:
c.Properties.AndroidMkRuntimeLibs = append(
- c.Properties.AndroidMkRuntimeLibs, MakeLibName(ccInfo, linkableInfo, &commonInfo,
+ c.Properties.AndroidMkRuntimeLibs, MakeLibName(ccInfo, linkableInfo, commonInfo,
commonInfo.BaseModuleName)+libDepTag.makeSuffix)
case objDepTag:
depPaths.Objs.objFiles = append(depPaths.Objs.objFiles, linkFile.Path())
@@ -3779,7 +3779,7 @@
// platform APIs, use stubs only when it is from an APEX (and not from
// platform) However, for host, ramdisk, vendor_ramdisk, recovery or
// bootstrap modules, always link to non-stub variant
- isNotInPlatform := android.OtherModuleProviderOrDefault(ctx, dep, android.CommonModuleInfoProvider).NotInPlatform
+ isNotInPlatform := android.OtherModulePointerProviderOrDefault(ctx, dep, android.CommonModuleInfoProvider).NotInPlatform
useStubs = isNotInPlatform && !bootstrap
} else {
diff --git a/cc/fuzz.go b/cc/fuzz.go
index ba34387..79874fc 100644
--- a/cc/fuzz.go
+++ b/cc/fuzz.go
@@ -486,7 +486,7 @@
sharedLibsInstallDirPrefix = "lib/vendor"
}
- commonInfo := android.OtherModuleProviderOrDefault(ctx, module, android.CommonModuleInfoProvider)
+ commonInfo := android.OtherModulePointerProviderOrDefault(ctx, module, android.CommonModuleInfoProvider)
isHost := commonInfo.Target.Os.Class == android.Host
hostOrTargetString := "target"
if commonInfo.Target.HostCross {
diff --git a/cc/ndk_abi.go b/cc/ndk_abi.go
index a59cc11..b96a779 100644
--- a/cc/ndk_abi.go
+++ b/cc/ndk_abi.go
@@ -40,7 +40,7 @@
func (n *ndkAbiDumpSingleton) GenerateBuildActions(ctx android.SingletonContext) {
var depPaths android.Paths
ctx.VisitAllModuleProxies(func(module android.ModuleProxy) {
- if !android.OtherModuleProviderOrDefault(ctx, module, android.CommonModuleInfoProvider).Enabled {
+ if !android.OtherModulePointerProviderOrDefault(ctx, module, android.CommonModuleInfoProvider).Enabled {
return
}
@@ -78,7 +78,7 @@
func (n *ndkAbiDiffSingleton) GenerateBuildActions(ctx android.SingletonContext) {
var depPaths android.Paths
ctx.VisitAllModuleProxies(func(module android.ModuleProxy) {
- if !android.OtherModuleProviderOrDefault(ctx, module, android.CommonModuleInfoProvider).Enabled {
+ if !android.OtherModulePointerProviderOrDefault(ctx, module, android.CommonModuleInfoProvider).Enabled {
return
}
diff --git a/cc/ndk_sysroot.go b/cc/ndk_sysroot.go
index 82a19d0..1677862 100644
--- a/cc/ndk_sysroot.go
+++ b/cc/ndk_sysroot.go
@@ -212,7 +212,7 @@
var licensePaths android.Paths
ctx.VisitAllModuleProxies(func(module android.ModuleProxy) {
- if !android.OtherModuleProviderOrDefault(ctx, module, android.CommonModuleInfoProvider).Enabled {
+ if !android.OtherModulePointerProviderOrDefault(ctx, module, android.CommonModuleInfoProvider).Enabled {
return
}
diff --git a/cc/tidy.go b/cc/tidy.go
index e8e1dc2..bf273e9 100644
--- a/cc/tidy.go
+++ b/cc/tidy.go
@@ -220,7 +220,7 @@
// (1) Collect all obj/tidy files into OS-specific groups.
ctx.VisitAllModuleVariantProxies(module, func(variant android.ModuleProxy) {
- osName := android.OtherModuleProviderOrDefault(ctx, variant, android.CommonModuleInfoProvider).Target.Os.Name
+ osName := android.OtherModulePointerProviderOrDefault(ctx, variant, android.CommonModuleInfoProvider).Target.Os.Name
info := android.OtherModuleProviderOrDefault(ctx, variant, CcObjectInfoProvider)
addToOSGroup(osName, info.ObjFiles, allObjFileGroups, subsetObjFileGroups)
addToOSGroup(osName, info.TidyFiles, allTidyFileGroups, subsetTidyFileGroups)