[llvm] 6480fe2 - [llvm] Drop unaligned from calls to llvm::support::endian::{read,write} (NFC)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 9 00:14:45 PDT 2023
Author: Kazu Hirata
Date: 2023-10-09T00:14:37-07:00
New Revision: 6480fe2bbf401e2a1581af4a2fc861eb8b9c87c3
URL: https://github.com/llvm/llvm-project/commit/6480fe2bbf401e2a1581af4a2fc861eb8b9c87c3
DIFF: https://github.com/llvm/llvm-project/commit/6480fe2bbf401e2a1581af4a2fc861eb8b9c87c3.diff
LOG: [llvm] Drop unaligned from calls to llvm::support::endian::{read,write} (NFC)
The last template parameter of llvm::support::endian::{read,write}
defaults to unaligned, so we can drop that at call sites.
Added:
Modified:
llvm/include/llvm/Support/BinaryStreamReader.h
llvm/include/llvm/Support/BinaryStreamWriter.h
llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h
Removed:
################################################################################
diff --git a/llvm/include/llvm/Support/BinaryStreamReader.h b/llvm/include/llvm/Support/BinaryStreamReader.h
index 056d2a5036d6a43..6a608d7167e5ac2 100644
--- a/llvm/include/llvm/Support/BinaryStreamReader.h
+++ b/llvm/include/llvm/Support/BinaryStreamReader.h
@@ -73,8 +73,7 @@ class BinaryStreamReader {
if (auto EC = readBytes(Bytes, sizeof(T)))
return EC;
- Dest = llvm::support::endian::read<T, llvm::support::unaligned>(
- Bytes.data(), Stream.getEndian());
+ Dest = llvm::support::endian::read<T>(Bytes.data(), Stream.getEndian());
return Error::success();
}
diff --git a/llvm/include/llvm/Support/BinaryStreamWriter.h b/llvm/include/llvm/Support/BinaryStreamWriter.h
index d3d5edbf69e5204..5a56c9fcc46bd94 100644
--- a/llvm/include/llvm/Support/BinaryStreamWriter.h
+++ b/llvm/include/llvm/Support/BinaryStreamWriter.h
@@ -59,8 +59,7 @@ class BinaryStreamWriter {
static_assert(std::is_integral_v<T>,
"Cannot call writeInteger with non-integral value!");
uint8_t Buffer[sizeof(T)];
- llvm::support::endian::write<T, llvm::support::unaligned>(
- Buffer, Value, Stream.getEndian());
+ llvm::support::endian::write<T>(Buffer, Value, Stream.getEndian());
return writeBytes(Buffer);
}
diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h
index 6435dc05cdc9254..1ae3ac179787fcb 100644
--- a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h
+++ b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h
@@ -318,17 +318,17 @@ class RuntimeDyldImpl {
std::string ErrorStr;
void writeInt16BE(uint8_t *Addr, uint16_t Value) {
- llvm::support::endian::write<uint16_t, llvm::support::unaligned>(
+ llvm::support::endian::write<uint16_t>(
Addr, Value, IsTargetLittleEndian ? support::little : support::big);
}
void writeInt32BE(uint8_t *Addr, uint32_t Value) {
- llvm::support::endian::write<uint32_t, llvm::support::unaligned>(
+ llvm::support::endian::write<uint32_t>(
Addr, Value, IsTargetLittleEndian ? support::little : support::big);
}
void writeInt64BE(uint8_t *Addr, uint64_t Value) {
- llvm::support::endian::write<uint64_t, llvm::support::unaligned>(
+ llvm::support::endian::write<uint64_t>(
Addr, Value, IsTargetLittleEndian ? support::little : support::big);
}
More information about the llvm-commits
mailing list