LLVM is gearing up to move to `std::endianness` and as part of that has
moved `llvm::support::endianness` to `llvm::endianness`
(bbdbcd83e6702f314d147a680247058a899ba261). Rename our uses.
LLVM is presumably moving towards `std::string_view` -
`StringRef::startswith` is deprecated on tip. `SmallString::startswith`
was just renamed there (maybe with some small deprecation inbetween, but
if so, we've missed it).
The `SmallString::startswith` references were moved to
`.str().starts_with()`, rather than adding the `starts_with` on
`stable/20230725` as we only had a few of them. Open to switching that
over if anyone feels strongly though.
- Add `LocalizationProducerState` to manage the states of LocalizationProducers.
- Add `initializeImpl` and `initializeIfNeeded` to manage lazily initialization of `LocalizationProducer`s.
- Move constructing a localization producer from DiagEngine to `LocalizationProrducer` itself.
Import `Path.h` and `FileSystem.h` directly since they are the source
of `llvm::sys::path::extension` and `llvm::system::fs::OpenFlags`
respectively.
Resolves: rdar://77277253
Require producers to implement `getMessage(DiagID)` and
establish default implementation of `getMessageOr`, so
producers don't have to worry about handling fallback if
translation is unavailable.
Create a new diagnostics serialization library, splitting out of
swiftAST to reduce the overheads for building the tooling for
cross-compiling the toolchain. This should reduce the build time for
swift-serialize-diagnostics to enable cross-compilation.