Address some overload deprecations in llvm::support::endian

See:
* https://github.com/llvm/llvm-project/pull/161045
* https://github.com/llvm/llvm-project/pull/160979
This commit is contained in:
Anthony Latsis
2025-12-01 11:19:25 +00:00
parent 403bb36f8e
commit 345c601626
2 changed files with 4 additions and 6 deletions

View File

@@ -397,9 +397,8 @@ createCachedCompilation(SwiftScanCAS &CAS, const llvm::cas::CASID &ID,
return KeyProxy.takeError(); return KeyProxy.takeError();
auto Input = KeyProxy->getData(); auto Input = KeyProxy->getData();
unsigned Index = unsigned Index = llvm::support::endian::read<uint32_t>(
llvm::support::endian::read<uint32_t, llvm::endianness::little, Input.data(), llvm::endianness::little);
llvm::support::unaligned>(Input.data());
{ {
swift::cas::CompileJobResultSchema Schema(CAS.getCAS()); swift::cas::CompileJobResultSchema Schema(CAS.getCAS());
if (Schema.isRootNode(*Proxy)) { if (Schema.isRootNode(*Proxy)) {

View File

@@ -240,9 +240,8 @@ int TestRunner::run() {
llvm::SmallVector<char, 0> response_data; llvm::SmallVector<char, 0> response_data;
llvm::raw_svector_ostream(response_data) << response; llvm::raw_svector_ostream(response_data) << response;
auto response_size = response_data.size(); auto response_size = response_data.size();
auto response_header = auto response_header = llvm::support::endian::byte_swap<uint64_t>(
llvm::support::endian::byte_swap<uint64_t, llvm::endianness::little>( response_size, llvm::endianness::little);
response_size);
ioSize = fwrite(&response_header, sizeof(response_header), 1, stdout); ioSize = fwrite(&response_header, sizeof(response_header), 1, stdout);
if (!ioSize) { if (!ioSize) {
llvm::errs() << "failed to write response header\n"; llvm::errs() << "failed to write response header\n";