Add MutatorName to mutator contexts

Allow querying the mutator name for debugging.

Bug: 136473661
Change-Id: I6a9f1f8cc4fd456d32cc2f2ef85a497c193d7e09
This commit is contained in:
Colin Cross 2019-07-01 15:27:04 -07:00
parent e3fb08a2cd
commit d8367ff746

View file

@ -675,6 +675,9 @@ type BaseMutatorContext interface {
// Rename all variants of a module. The new name is not visible to calls to ModuleName,
// AddDependency or OtherModuleName until after this mutator pass is complete.
Rename(name string)
// MutatorName returns the name that this mutator was registered with.
MutatorName() string
}
type EarlyMutatorContext interface {
@ -808,6 +811,10 @@ func (BaseDependencyTag) dependencyTag(DependencyTag) {
var _ DependencyTag = BaseDependencyTag{}
func (mctx *mutatorContext) MutatorName() string {
return mctx.name
}
func (mctx *mutatorContext) CreateVariations(variationNames ...string) []Module {
return mctx.createVariations(variationNames, false)
}