Convert AFDO mutators to TransitionMutator

Convert afdoDepsMutator and afdoMutator to a TransitionMutator as a
step towards variants-on-demand.

Bug: 319288033
Test: afdo_test.go
Change-Id: Ib05845455ccf43a07b3915a0d7b0a95896062f13
diff --git a/cc/cc.go b/cc/cc.go
index 1a9c7bf..cac52cf 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -55,7 +55,7 @@
 		ctx.BottomUp("test_per_src", TestPerSrcMutator).Parallel()
 		ctx.BottomUp("version", versionMutator).Parallel()
 		ctx.BottomUp("begin", BeginMutator).Parallel()
-		ctx.BottomUp("fdo_profile", fdoProfileMutator)
+		ctx.BottomUp("fdo_profile", fdoProfileMutator).Parallel()
 	})
 
 	ctx.PostDepsMutators(func(ctx android.RegisterMutatorsContext) {
@@ -70,8 +70,7 @@
 
 		ctx.Transition("coverage", &coverageTransitionMutator{})
 
-		ctx.TopDown("afdo_deps", afdoDepsMutator)
-		ctx.BottomUp("afdo", afdoMutator).Parallel()
+		ctx.Transition("afdo", &afdoTransitionMutator{})
 
 		ctx.Transition("orderfile", &orderfileTransitionMutator{})
 
@@ -2339,10 +2338,6 @@
 	}
 	ctx.ctx = ctx
 
-	if !actx.Host() || !ctx.static() || ctx.staticBinary() {
-		c.afdo.addDep(ctx, actx)
-	}
-
 	c.begin(ctx)
 }