From 3b606c8218c18521aae77fcf385d0e8ff8fdb8de Mon Sep 17 00:00:00 2001 From: Liz Kammer Date: Fri, 25 Jun 2021 15:57:46 -0400 Subject: [PATCH] Delete unused functions As they're unused, also removing them from the interface. Test: go test soong tests Change-Id: I76e7cbca12876395d8d7eaae4481c5e0d1350d76 --- cc/cc.go | 26 -------------------------- cc/lto.go | 4 ---- cc/sabi.go | 6 ------ cc/sanitize.go | 8 -------- cc/tidy.go | 7 ------- cc/vndk.go | 6 ------ 6 files changed, 57 deletions(-) diff --git a/cc/cc.go b/cc/cc.go index 15cb39a77..61064e910 100644 --- a/cc/cc.go +++ b/cc/cc.go @@ -525,8 +525,6 @@ type DepsContext interface { // feature represents additional (optional) steps to building cc-related modules, such as invocation // of clang-tidy. type feature interface { - begin(ctx BaseModuleContext) - deps(ctx DepsContext, deps Deps) Deps flags(ctx ModuleContext, flags Flags) Flags props() []interface{} } @@ -1897,21 +1895,12 @@ func (c *Module) begin(ctx BaseModuleContext) { if c.coverage != nil { c.coverage.begin(ctx) } - if c.sabi != nil { - c.sabi.begin(ctx) - } - if c.vndkdep != nil { - c.vndkdep.begin(ctx) - } if c.lto != nil { c.lto.begin(ctx) } if c.pgo != nil { c.pgo.begin(ctx) } - for _, feature := range c.features { - feature.begin(ctx) - } if ctx.useSdk() && c.IsSdkVariant() { version, err := nativeApiLevelFromUser(ctx, ctx.sdkVersion()) if err != nil { @@ -1935,24 +1924,9 @@ func (c *Module) deps(ctx DepsContext) Deps { if c.stl != nil { deps = c.stl.deps(ctx, deps) } - if c.sanitize != nil { - deps = c.sanitize.deps(ctx, deps) - } if c.coverage != nil { deps = c.coverage.deps(ctx, deps) } - if c.sabi != nil { - deps = c.sabi.deps(ctx, deps) - } - if c.vndkdep != nil { - deps = c.vndkdep.deps(ctx, deps) - } - if c.lto != nil { - deps = c.lto.deps(ctx, deps) - } - for _, feature := range c.features { - deps = feature.deps(ctx, deps) - } deps.WholeStaticLibs = android.LastUniqueStrings(deps.WholeStaticLibs) deps.StaticLibs = android.LastUniqueStrings(deps.StaticLibs) diff --git a/cc/lto.go b/cc/lto.go index a3b28d9a2..fccb5972a 100644 --- a/cc/lto.go +++ b/cc/lto.go @@ -80,10 +80,6 @@ func (lto *lto) begin(ctx BaseModuleContext) { } } -func (lto *lto) deps(ctx BaseModuleContext, deps Deps) Deps { - return deps -} - func (lto *lto) useClangLld(ctx BaseModuleContext) bool { if lto.Properties.Use_clang_lld != nil { return Bool(lto.Properties.Use_clang_lld) diff --git a/cc/sabi.go b/cc/sabi.go index 1f331cb3d..5fd6f5da3 100644 --- a/cc/sabi.go +++ b/cc/sabi.go @@ -45,12 +45,6 @@ func (sabi *sabi) props() []interface{} { return []interface{}{&sabi.Properties} } -func (sabi *sabi) begin(ctx BaseModuleContext) {} - -func (sabi *sabi) deps(ctx BaseModuleContext, deps Deps) Deps { - return deps -} - func (sabi *sabi) flags(ctx ModuleContext, flags Flags) Flags { // Filter out flags which libTooling don't understand. // This is here for legacy reasons and future-proof, in case the version of libTooling and clang diff --git a/cc/sanitize.go b/cc/sanitize.go index b0eb0c6ab..cdd7dfbf3 100644 --- a/cc/sanitize.go +++ b/cc/sanitize.go @@ -499,14 +499,6 @@ func (sanitize *sanitize) begin(ctx BaseModuleContext) { } } -func (sanitize *sanitize) deps(ctx BaseModuleContext, deps Deps) Deps { - if !sanitize.Properties.SanitizerEnabled { // || c.static() { - return deps - } - - return deps -} - func toDisableImplicitIntegerChange(flags []string) bool { // Returns true if any flag is fsanitize*integer, and there is // no explicit flag about sanitize=implicit-integer-sign-change. diff --git a/cc/tidy.go b/cc/tidy.go index 616cf8ab4..b2382e88a 100644 --- a/cc/tidy.go +++ b/cc/tidy.go @@ -61,13 +61,6 @@ func (tidy *tidyFeature) props() []interface{} { return []interface{}{&tidy.Properties} } -func (tidy *tidyFeature) begin(ctx BaseModuleContext) { -} - -func (tidy *tidyFeature) deps(ctx DepsContext, deps Deps) Deps { - return deps -} - func (tidy *tidyFeature) flags(ctx ModuleContext, flags Flags) Flags { CheckBadTidyFlags(ctx, "tidy_flags", tidy.Properties.Tidy_flags) CheckBadTidyChecks(ctx, "tidy_checks", tidy.Properties.Tidy_checks) diff --git a/cc/vndk.go b/cc/vndk.go index 0b4007605..499d4282c 100644 --- a/cc/vndk.go +++ b/cc/vndk.go @@ -100,12 +100,6 @@ func (vndk *vndkdep) props() []interface{} { return []interface{}{&vndk.Properties} } -func (vndk *vndkdep) begin(ctx BaseModuleContext) {} - -func (vndk *vndkdep) deps(ctx BaseModuleContext, deps Deps) Deps { - return deps -} - func (vndk *vndkdep) isVndk() bool { return Bool(vndk.Properties.Vndk.Enabled) }