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/compiler.go b/cc/compiler.go
index 4eae898..c9dcf95 100644
--- a/cc/compiler.go
+++ b/cc/compiler.go
@@ -157,7 +157,8 @@
 type baseCompiler struct {
 	Properties BaseCompilerProperties
 	Proto      android.ProtoProperties
-	deps       android.Paths
+	genDeps    android.Paths
+	pathDeps   android.Paths
 	flags      builderFlags
 
 	// Sources that were passed to the C/C++ compiler
@@ -536,17 +537,16 @@
 	srcs := append(android.Paths(nil), compiler.srcsBeforeGen...)
 
 	srcs, genDeps := genSources(ctx, srcs, buildFlags)
-
-	pathDeps = append(pathDeps, genDeps...)
 	pathDeps = append(pathDeps, flags.CFlagsDeps...)
 
-	compiler.deps = pathDeps
+	compiler.pathDeps = pathDeps
+	compiler.genDeps = genDeps
 
 	// Save src, buildFlags and context
 	compiler.srcs = srcs
 
 	// Compile files listed in c.Properties.Srcs into objects
-	objs := compileObjs(ctx, buildFlags, "", srcs, compiler.deps)
+	objs := compileObjs(ctx, buildFlags, "", srcs, pathDeps, genDeps)
 
 	if ctx.Failed() {
 		return Objects{}
@@ -557,7 +557,7 @@
 
 // Compile a list of source files into objects a specified subdirectory
 func compileObjs(ctx android.ModuleContext, flags builderFlags,
-	subdir string, srcFiles, deps android.Paths) Objects {
+	subdir string, srcFiles, pathDeps android.Paths, genDeps android.Paths) Objects {
 
-	return TransformSourceToObj(ctx, subdir, srcFiles, flags, deps)
+	return TransformSourceToObj(ctx, subdir, srcFiles, flags, pathDeps, genDeps)
 }