Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 187d5445 authored by Liz Kammer's avatar Liz Kammer
Browse files

Remove IsDependencyRoot from interface

This is equivalent to Binary() -- reduce the interface and improve
clarity.

Test: go test soong tests
Change-Id: I770f5ce79fd4d888586d31ec5e67be88153626b6
parent b2fc4700
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -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.
+0 −11
Original line number Diff line number Diff line
@@ -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 != ""
}
+0 −5
Original line number Diff line number Diff line
@@ -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

+1 −1
Original line number Diff line number Diff line
@@ -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() {
+0 −4
Original line number Diff line number Diff line
@@ -155,7 +155,3 @@ func (binary *binaryDecorator) stdLinkage(ctx *depsContext) RustLinkage {
	}
	return binary.baseCompiler.stdLinkage(ctx)
}

func (binary *binaryDecorator) isDependencyRoot() bool {
	return true
}
Loading