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
This commit is contained in:
22
cc/cc.go
22
cc/cc.go
@@ -76,8 +76,8 @@ type PathDeps struct {
|
||||
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 @@ type compiler interface {
|
||||
|
||||
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 @@ type linker interface {
|
||||
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 @@ func (c *Module) GenerateAndroidBuildActions(actx android.ModuleContext) {
|
||||
|
||||
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 @@ func (c *Module) depsToPaths(ctx android.ModuleContext) PathDeps {
|
||||
}
|
||||
|
||||
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 @@ func (c *Module) depsToPaths(ctx android.ModuleContext) PathDeps {
|
||||
}
|
||||
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:
|
||||
|
Reference in New Issue
Block a user