Iterate over sanitizers
Test: go test soong tests Change-Id: If89b7d0b04cad79b42a08504d4fcff36e914b7a4
This commit is contained in:
@@ -79,12 +79,23 @@ const (
|
||||
Hwasan
|
||||
tsan
|
||||
intOverflow
|
||||
cfi
|
||||
scs
|
||||
Fuzzer
|
||||
memtag_heap
|
||||
cfi // cfi is last to prevent it running before incompatible mutators
|
||||
)
|
||||
|
||||
var Sanitizers = []SanitizerType{
|
||||
Asan,
|
||||
Hwasan,
|
||||
tsan,
|
||||
intOverflow,
|
||||
scs,
|
||||
Fuzzer,
|
||||
memtag_heap,
|
||||
cfi, // cfi is last to prevent it running before incompatible mutators
|
||||
}
|
||||
|
||||
// Name of the sanitizer variation for this sanitizer type
|
||||
func (t SanitizerType) variationName() string {
|
||||
switch t {
|
||||
@@ -133,6 +144,18 @@ func (t SanitizerType) name() string {
|
||||
}
|
||||
}
|
||||
|
||||
func (t SanitizerType) registerMutators(ctx android.RegisterMutatorsContext) {
|
||||
switch t {
|
||||
case Asan, Hwasan, Fuzzer, scs, tsan, cfi:
|
||||
ctx.TopDown(t.variationName()+"_deps", sanitizerDepsMutator(t))
|
||||
ctx.BottomUp(t.variationName(), sanitizerMutator(t))
|
||||
case memtag_heap, intOverflow:
|
||||
// do nothing
|
||||
default:
|
||||
panic(fmt.Errorf("unknown SanitizerType %d", t))
|
||||
}
|
||||
}
|
||||
|
||||
func (*Module) SanitizerSupported(t SanitizerType) bool {
|
||||
switch t {
|
||||
case Asan:
|
||||
|
Reference in New Issue
Block a user