Use a less hacky way to detect if a module is Fuzzer enabled
Bug: 169004486
Test: presubmit
Change-Id: I7fad86041622979b9befb7c86897a13f604bdf3d
diff --git a/cc/cc.go b/cc/cc.go
index c9f00e2..2bfb372 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -524,6 +524,7 @@
isAfdoCompile() bool
isPgoCompile() bool
isCfi() bool
+ isFuzzer() bool
isNDKStubLibrary() bool
useClangLld(actx ModuleContext) bool
isForPlatform() bool
@@ -1365,6 +1366,13 @@
return false
}
+func (c *Module) isFuzzer() bool {
+ if sanitize := c.sanitize; sanitize != nil {
+ return Bool(sanitize.Properties.SanitizeMutated.Fuzzer)
+ }
+ return false
+}
+
func (c *Module) isNDKStubLibrary() bool {
if _, ok := c.compiler.(*stubDecorator); ok {
return true
@@ -1660,6 +1668,10 @@
return ctx.mod.isCfi()
}
+func (ctx *moduleContextImpl) isFuzzer() bool {
+ return ctx.mod.isFuzzer()
+}
+
func (ctx *moduleContextImpl) isNDKStubLibrary() bool {
return ctx.mod.isNDKStubLibrary()
}