Add compile-time pathDeps as implicit dependencies

Bug: http://b/70820751
Bug: http://b/70857959

Clang does not output file dependencies from the -fprofile-use= flag
during -MD/-MM.  Add this and other path dependencies as implicit Ninja
dependencies.  Generated header dependencies are retained as OrderOnly
dependencies.

Test: Perturb profdata files for hwui/skia in internal branch and verify
that the sources get rebuilt.

Change-Id: I3247d995ee27a4882172eb15ff36acf56536b6f7
diff --git a/cc/builder.go b/cc/builder.go
index e583834..de85d6e 100644
--- a/cc/builder.go
+++ b/cc/builder.go
@@ -290,7 +290,7 @@
 
 // Generate rules for compiling multiple .c, .cpp, or .S files to individual .o files
 func TransformSourceToObj(ctx android.ModuleContext, subdir string, srcFiles android.Paths,
-	flags builderFlags, deps android.Paths) Objects {
+	flags builderFlags, pathDeps android.Paths, genDeps android.Paths) Objects {
 
 	objFiles := make(android.Paths, len(srcFiles))
 	var tidyFiles android.Paths
@@ -363,7 +363,8 @@
 				Description: "yasm " + srcFile.Rel(),
 				Output:      objFile,
 				Input:       srcFile,
-				OrderOnly:   deps,
+				Implicits:   pathDeps,
+				OrderOnly:   genDeps,
 				Args: map[string]string{
 					"asFlags": flags.yasmFlags,
 				},
@@ -375,7 +376,8 @@
 				Description: "windres " + srcFile.Rel(),
 				Output:      objFile,
 				Input:       srcFile,
-				OrderOnly:   deps,
+				Implicits:   pathDeps,
+				OrderOnly:   genDeps,
 				Args: map[string]string{
 					"windresCmd": gccCmd(flags.toolchain, "windres"),
 					"flags":      flags.toolchain.WindresFlags(),
@@ -443,7 +445,8 @@
 			Output:          objFile,
 			ImplicitOutputs: implicitOutputs,
 			Input:           srcFile,
-			OrderOnly:       deps,
+			Implicits:       pathDeps,
+			OrderOnly:       genDeps,
 			Args: map[string]string{
 				"cFlags": moduleCflags,
 				"ccCmd":  ccCmd,