diff --git a/cc/binary.go b/cc/binary.go index 48f70d9b8..c177a0899 100644 --- a/cc/binary.go +++ b/cc/binary.go @@ -183,11 +183,6 @@ func (binary *binaryDecorator) linkerDeps(ctx DepsContext, deps Deps) Deps { return deps } -func (binary *binaryDecorator) isDependencyRoot() bool { - // Binaries are always the dependency root. - return true -} - // NewBinary builds and returns a new Module corresponding to a C++ binary. // Individual module implementations which comprise a C++ binary should call this function, // set some fields on the result, and then call the Init function. diff --git a/cc/cc.go b/cc/cc.go index 1f73149ee..ca889137e 100644 --- a/cc/cc.go +++ b/cc/cc.go @@ -1119,17 +1119,6 @@ func (c *Module) Init() android.Module { return c } -// Returns true for dependency roots (binaries) -// TODO(ccross): also handle dlopenable libraries -func (c *Module) IsDependencyRoot() bool { - if root, ok := c.linker.(interface { - isDependencyRoot() bool - }); ok { - return root.isDependencyRoot() - } - return false -} - func (c *Module) UseVndk() bool { return c.Properties.VndkVersion != "" } diff --git a/cc/linkable.go b/cc/linkable.go index dd87334a3..c42c875b4 100644 --- a/cc/linkable.go +++ b/cc/linkable.go @@ -14,11 +14,6 @@ type PlatformSanitizeable interface { // SanitizePropDefined returns whether the Sanitizer properties struct for this module is defined. SanitizePropDefined() bool - // IsDependencyRoot returns whether a module is of a type which cannot be a linkage dependency - // of another module. For example, cc_binary and rust_binary represent dependency roots as other - // modules cannot have linkage dependencies against these types. - IsDependencyRoot() bool - // IsSanitizerEnabled returns whether a sanitizer is enabled. IsSanitizerEnabled(t SanitizerType) bool diff --git a/cc/sanitize.go b/cc/sanitize.go index 4cc70e0e9..e95a9354d 100644 --- a/cc/sanitize.go +++ b/cc/sanitize.go @@ -1250,7 +1250,7 @@ var _ PlatformSanitizeable = (*Module)(nil) func sanitizerMutator(t SanitizerType) func(android.BottomUpMutatorContext) { return func(mctx android.BottomUpMutatorContext) { if c, ok := mctx.Module().(PlatformSanitizeable); ok && c.SanitizePropDefined() { - if c.IsDependencyRoot() && c.IsSanitizerEnabled(t) { + if c.Binary() && c.IsSanitizerEnabled(t) { modules := mctx.CreateVariations(t.variationName()) modules[0].(PlatformSanitizeable).SetSanitizer(t, true) } else if c.IsSanitizerEnabled(t) || c.SanitizeDep() { diff --git a/rust/binary.go b/rust/binary.go index 8d0a0a7a0..2c3f54835 100644 --- a/rust/binary.go +++ b/rust/binary.go @@ -155,7 +155,3 @@ func (binary *binaryDecorator) stdLinkage(ctx *depsContext) RustLinkage { } return binary.baseCompiler.stdLinkage(ctx) } - -func (binary *binaryDecorator) isDependencyRoot() bool { - return true -} diff --git a/rust/compiler.go b/rust/compiler.go index 1598ebf9a..0b28135ae 100644 --- a/rust/compiler.go +++ b/rust/compiler.go @@ -289,10 +289,6 @@ func (compiler *baseCompiler) CargoOutDir() android.OptionalPath { return android.OptionalPathForPath(compiler.cargoOutDir) } -func (compiler *baseCompiler) isDependencyRoot() bool { - return false -} - func (compiler *baseCompiler) strippedOutputFilePath() android.OptionalPath { return compiler.strippedOutputFile } diff --git a/rust/rust.go b/rust/rust.go index a11a04c89..0a9869fdc 100644 --- a/rust/rust.go +++ b/rust/rust.go @@ -172,13 +172,6 @@ func (mod *Module) SanitizePropDefined() bool { return mod.sanitize != nil && mod.compiler != nil } -func (mod *Module) IsDependencyRoot() bool { - if mod.compiler != nil { - return mod.compiler.isDependencyRoot() - } - panic("IsDependencyRoot called on a non-compiler Rust module") -} - func (mod *Module) IsPrebuilt() bool { if _, ok := mod.compiler.(*prebuiltLibraryDecorator); ok { return true @@ -449,7 +442,6 @@ type compiler interface { SetDisabled() stdLinkage(ctx *depsContext) RustLinkage - isDependencyRoot() bool strippedOutputFilePath() android.OptionalPath }