T *const does not prevent logically non-const accesses to the underlying data, it merely indicates that the pointer value itself is const. This modifier can be cast off by a copy, so it's not generally what you want here. Switch to const T * instead.
Invert the responsibility of the entrypoint so that FrontendTool is directing the actual serialization work. The entrypoint now solely exists to construct a dependency graph.
While I'm here, prepare the way for serializing dependency graphs for modules by optimistically modeling a ModuleOrSourceFile input.
Take advantage of the binary swiftdeps serialization utliities built during #32131. Add a new optional information block to swiftdeps files. For now, don't actually serialize swiftdeps information.
Frontends will use this information to determine whether to write incremental dependencies across modules into their swiftdeps files. We will then teach the driver to deserialize the data from this section and integrate it into its incremental decision making.
Strip mention of the SourceFile. Any FileUnit-esque thing that can provide top-level decls and `lookupClassMembers` works here - especially a ModuleDecl.
The final set of edges that were being registered cascading were external edges. Just mark these all private - they're duplicated into the swiftdeps for each file that imports a given (usually clang) module anyways.
This abstraction turns out to have hidden dependencies from the dependency verifier. Invert the dependency here and have it use the new enumerators in the DependencyRecorder instead.
Request-based incremental dependencies are enabled by default. For the time being, add a flag that will turn them off and switch back to manual dependency tracking.