Start using "struct Objects" to store object Paths
So that we can represent other files that get generated along with the
objects, like the gcno coverage information, and per-file clang-tidy
runs.
Test: Soong's build.ninja identical before/after
Change-Id: I5c553a153c436d5403549f62c73fe79c5f101779
diff --git a/cc/cc.go b/cc/cc.go
index 33c9611..c2884ac 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -76,8 +76,8 @@
StaticLibs, LateStaticLibs, WholeStaticLibs android.Paths
// Paths to .o files
- ObjFiles android.Paths
- WholeStaticLibObjFiles android.Paths
+ Objs Objects
+ WholeStaticLibObjs Objects
// Paths to generated source files
GeneratedSources android.Paths
@@ -174,7 +174,7 @@
appendCflags([]string)
appendAsflags([]string)
- compile(ctx ModuleContext, flags Flags, deps PathDeps) android.Paths
+ compile(ctx ModuleContext, flags Flags, deps PathDeps) Objects
}
type linker interface {
@@ -183,7 +183,7 @@
linkerFlags(ctx ModuleContext, flags Flags) Flags
linkerProps() []interface{}
- link(ctx ModuleContext, flags Flags, deps PathDeps, objFiles android.Paths) android.Path
+ link(ctx ModuleContext, flags Flags, deps PathDeps, objs Objects) android.Path
appendLdflags([]string)
}
@@ -440,16 +440,16 @@
flags.GlobalFlags = append(flags.GlobalFlags, deps.Flags...)
- var objFiles android.Paths
+ var objs Objects
if c.compiler != nil {
- objFiles = c.compiler.compile(ctx, flags, deps)
+ objs = c.compiler.compile(ctx, flags, deps)
if ctx.Failed() {
return
}
}
if c.linker != nil {
- outputFile := c.linker.link(ctx, flags, deps, objFiles)
+ outputFile := c.linker.link(ctx, flags, deps, objs)
if ctx.Failed() {
return
}
@@ -813,8 +813,7 @@
}
if tag == reuseObjTag {
- depPaths.ObjFiles = append(depPaths.ObjFiles,
- cc.compiler.(libraryInterface).reuseObjs()...)
+ depPaths.Objs = depPaths.Objs.Append(cc.compiler.(libraryInterface).reuseObjs())
return
}
@@ -868,10 +867,9 @@
}
ctx.AddMissingDependencies(missingDeps)
}
- depPaths.WholeStaticLibObjFiles =
- append(depPaths.WholeStaticLibObjFiles, staticLib.objs()...)
+ depPaths.WholeStaticLibObjs = depPaths.WholeStaticLibObjs.Append(staticLib.objs())
case objDepTag:
- ptr = &depPaths.ObjFiles
+ depPaths.Objs.objFiles = append(depPaths.Objs.objFiles, linkFile.Path())
case crtBeginDepTag:
depPaths.CrtBegin = linkFile
case crtEndDepTag: