Commit message:
Fine. Compute and persist LibraryManifest.hashForRequirements
Introduce a stable, order-independent hash derived from exactly the
parts of a library manifest that the requirements checker reads. This
hash is stored on each `LibraryManifest` (`hashForRequirements`) and
serialized as part of the binary format. When unchanged, it serves as a
fast path to skip the detailed `RequirementsManifest.isSatisfied` walk;
when it differs, the full check is re-run.
Key details:
- Hash content covers:
- Library identity and flags (name, `isSynthetic`, `featureSet`),
language versions (package/override), and `libraryMetadata.id`.
- Export surface (sorted `exportedLibraryUris`, re-export
`deprecatedOnly` names).
- All declared top-level items; for instance/Interface items also hash
members, inherited constructors, `hasNonFinalField`, and the
interface id.
- Export map id and entries, and exported extension ids.
- Determinism is ensured by sorting map entries by `LookupName` and
lists before hashing.
- New helpers on `ApiSignature` (`addList`, `addMapEntryList`) simplify
writing length-prefixed sequences.
- The manifest printer now shows the requirements hash as a compact
`#H*` identifier to aid debugging.
- Binary format change bumps `AnalysisDriver.DATA_VERSION` to 563.
This change provides a cheap, deterministic indicator for whether a
library’s manifest remains equivalent for requirements checking,
reducing unnecessary revalidation while preserving correctness.